<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
        
    <title>java - Not able to find files and images under src directory - Stack Overflow</title>
    <link rel="shortcut icon" href="http://cdn.sstatic.net/stackoverflow/img/favicon.ico">
    <link rel="apple-touch-icon image_src" href="http://cdn.sstatic.net/stackoverflow/img/apple-touch-icon.png">
    <link rel="search" type="application/opensearchdescription+xml" title="Stack Overflow" href="http://stackoverflow.com/opensearch.xml">
    
    <script src="java%20-%20Not%20able%20to%20find%20files%20and%20images%20under%20src%20directory%20-%20Stack%20Overflow_files/adzerk1_2_4_43adzerk2_2_17_45" async="" type="text/javascript"></script><script src="java%20-%20Not%20able%20to%20find%20files%20and%20images%20under%20src%20directory%20-%20Stack%20Overflow_files/ga.js" async="" type="text/javascript"></script><script src="java%20-%20Not%20able%20to%20find%20files%20and%20images%20under%20src%20directory%20-%20Stack%20Overflow_files/quant.js" async="" type="text/javascript"></script><script type="text/javascript" src="java%20-%20Not%20able%20to%20find%20files%20and%20images%20under%20src%20directory%20-%20Stack%20Overflow_files/jquery.js"></script>
    <script type="text/javascript" src="java%20-%20Not%20able%20to%20find%20files%20and%20images%20under%20src%20directory%20-%20Stack%20Overflow_files/stub.js"></script>
    <link rel="stylesheet" type="text/css" href="java%20-%20Not%20able%20to%20find%20files%20and%20images%20under%20src%20directory%20-%20Stack%20Overflow_files/all.css">
    
    <meta name="relativepagescore" content="5555">
    <link rel="canonical" href="http://stackoverflow.com/questions/15439429/not-able-to-find-files-and-images-under-src-directory">
    <link rel="alternate" type="application/atom+xml" title="Feed for question 'Not able to find files and images under src directory'" href="http://stackoverflow.com/feeds/question/15439429">
    <script type="text/javascript">
        
        StackExchange.ready(function () {
            StackExchange.using("postValidation", function () {
                StackExchange.postValidation.initOnBlurAndSubmit($('#post-form'), 2, 'answer');
            });

            
            StackExchange.question.init({showAnswerHelp:true,totalCommentCount:2,shownCommentCount:2,highlightColor:'#F4A83D',backgroundColor:'#FFF',questionId:15439429});

            styleCode();

                StackExchange.realtime.subscribeToQuestion('1', '15439429');
            
                
        });
    </script>


    <script type="text/javascript">
        StackExchange.init({"stackAuthUrl":"https://stackauth.com","serverTime":1366707392,"styleCode":true,"enableUserHovercards":true,"site":{"name":"Stack Overflow","description":"Q&A for professional and enthusiast programmers","isNoticesTabEnabled":true,"recaptchaPublicKey":"6LdchgIAAAAAAJwGpIzRQSOFaO0pU6s44Xt8aTwc","useNewStyleFavoriteTagsEditor":true,"enableSocialMediaInSharePopup":true},"user":{"fkey":"d3c890adcb315ce0e9c6e42f15b22e68","isAnonymous":true}});
        StackExchange.using.setCacheBreakers({"js/prettify-full.js":"6c261bebf56a","js/moderator.js":"f96f7e4ee5dc","js/full-anon.js":"4aa778f20142","js/full.js":"2cb347042411","js/wmd.js":"e62e6bd6c127","js/third-party/jquery.autocomplete.min.js":"e5f01e97f7c3","js/mobile.js":"6eb68240242f","js/help.js":"fc9fb0517db2","js/tageditor.js":"450c9e8426fc","js/tageditornew.js":"b6c68ad4c7dd","js/inline-tag-editing.js":"8e84e8a137f7","js/revisions.js":"7273bb714bba","js/review.js":"56c3941a5bfc","js/tagsuggestions.js":"aa48ef6154df","js/post-validation.js":"98fa812e7e1a","js/explore-qlist.js":"44794e78c6be"});
        
    </script>
        <script type="text/javascript">
        StackExchange.using("gps", function() {
             StackExchange.gps.init(true);
        });
    </script>
    
<script src="java%20-%20Not%20able%20to%20find%20files%20and%20images%20under%20src%20directory%20-%20Stack%20Overflow_files/full-anon.js" type="text/javascript" async=""></script><script src="java%20-%20Not%20able%20to%20find%20files%20and%20images%20under%20src%20directory%20-%20Stack%20Overflow_files/post-validation.js" type="text/javascript" async=""></script><script src="java%20-%20Not%20able%20to%20find%20files%20and%20images%20under%20src%20directory%20-%20Stack%20Overflow_files/prettify-full.js" type="text/javascript" async=""></script><script>try {  for(var lastpass_iter=0; lastpass_iter < document.forms.length; lastpass_iter++){    var lastpass_f = document.forms[lastpass_iter];    if(typeof(lastpass_f.lpsubmitorig)=="undefined"){      if (typeof(lastpass_f.submit) == "function") {        lastpass_f.lpsubmitorig = lastpass_f.submit;        lastpass_f.submit = function(){          var form = this;          try {            if (document.documentElement && 'createEvent' in document)            {              var forms = document.getElementsByTagName('form');              for (var i=0 ; i<forms.length ; ++i)                if (forms[i]==form)                {                  var element = document.createElement('lpformsubmitdataelement');                  element.setAttribute('formnum',i);                  element.setAttribute('from','submithook');                  document.documentElement.appendChild(element);                  var evt = document.createEvent('Events');                  evt.initEvent('lpformsubmit',true,false);                  element.dispatchEvent(evt);                  break;                }            }          } catch (e) {}          try {            form.lpsubmitorig();          } catch (e) {}        }      }    }  }} catch (e) {}</script></head>
<body class="question-page">
    <noscript><div id="noscript-padding"></div></noscript>
    <div id="notify-container"></div>
    <div id="overlay-header"></div>
    <div id="custom-header"></div>

    <div class="container">
        <div id="header">
            <div id="portalLink">
                <a class="genu" onclick="StackExchange.ready(function(){genuwine.click();});return false;">Stack Exchange</a>
            </div>
            <div id="topbar">
                <div id="hlinks">
                    
<span id="hlinks-user"></span>
<span id="hlinks-nav">                    <a href="http://stackoverflow.com/users/login?returnurl=%2fquestions%2f15439429%2fnot-able-to-find-files-and-images-under-src-directory">log in</a>

 <span class="lsep">|</span>
                    <a href="http://careers.stackoverflow.com/">careers 2.0</a>

 <span class="lsep">|</span>
</span>
<span id="hlinks-custom">            <a href="http://chat.stackoverflow.com/">chat</a>

 <span class="lsep">|</span>
                <a href="http://meta.stackoverflow.com/">meta</a>

 <span class="lsep">|</span>
            <a href="http://stackoverflow.com/about">about</a>

 <span class="lsep">|</span>
        <a href="http://stackoverflow.com/faq">faq</a>
</span>
                </div>
                <div id="hsearch">
                    <form id="search" action="/search" method="get" autocomplete="off">
                        <div>
                            <input autocomplete="off" name="q" class="textbox" placeholder="search" tabindex="1" maxlength="240" size="28" type="text">
                        </div>
                    </form>
                </div>
            </div>
            <br class="cbt">
            <div id="hlogo">
                <a href="http://stackoverflow.com/">
                    Stack Overflow
                </a>
            </div>
            <div id="hmenus">
                <div class="nav mainnavs ">
                    <ul>
                            <li class="youarehere"><a id="nav-questions" href="http://stackoverflow.com/questions">Questions</a></li>
                            <li><a id="nav-tags" href="http://stackoverflow.com/tags">Tags</a></li>
                            <li><a id="nav-users" href="http://stackoverflow.com/users">Users</a></li>
                            <li><a id="nav-badges" href="http://stackoverflow.com/badges">Badges</a></li>
                            <li><a id="nav-unanswered" href="http://stackoverflow.com/unanswered">Unanswered</a></li>
                    </ul>
                </div>
                <div class="nav askquestion">
                    <ul>
                        <li>
                            <a id="nav-askquestion" href="http://stackoverflow.com/questions/ask">Ask Question</a>
                        </li>
                    </ul>
                </div>
            </div>
        </div>

        



        <div id="content">
            

<div itemscope="" itemtype="http://schema.org/Article">
<link itemprop="image" href="http://cdn.sstatic.net/stackoverflow/img/apple-touch-icon.png">
<div id="herobox-mini">
    <div id="hero-content">
        <span id="controls">
            <a href="http://stackoverflow.com/about" id="tell-me-more" class="button">Tell me more</a>
            <span id="close"><a title="click to dismiss">×</a></span>
        </span>
        <div id="blurb">
            <span id="site-name">Stack Overflow</span> is a question and answer site for 
            professional and enthusiast programmers. It's 100% free, no registration required.
        </div>        
    </div>
    <script>
        $('#tell-me-more').click(function () {
            var clickSource = $("body").attr("class") + '-mini';
            if ($("body").hasClass("questions-page")) {
                clickSource = 'questionpagemini';
            }
            if ($("body").hasClass("home-page")) {
                clickSource = 'homepagemini';
            }

            StackExchange.using("gps", function () {
                StackExchange.gps.track("aboutpage.click", { aboutclick_location: clickSource } , true);
            });
        });
        $('#herobox-mini #close').click(function () {
            $.cookie("hero", "none", { path: "/" });
            var $hero = $("#herobox-mini");
            $hero.slideUp('fast', function () { $hero.remove(); });
            return false;
        });
    </script>
</div>
<div id="question-header">
    <h1 itemprop="name"><a href="http://stackoverflow.com/questions/15439429/not-able-to-find-files-and-images-under-src-directory" class="question-hyperlink">Not able to find files and images under src directory</a></h1>
</div>
<div id="mainbar">



<div class="question" data-questionid="15439429" id="question">
    
            <div class="everyonelovesstackoverflow" id="adzerk1">
        </div>


    <table>
        <tbody><tr>
            <td class="votecell">
                

<div class="vote">
    <input value="15439429" type="hidden">
    <a class="vote-up-off" title="This question shows research effort; it is useful and clear (click again to undo)">up vote</a>
    <span class="vote-count-post ">0</span>
    <a class="vote-down-off" title="This question does not show any research effort; it is unclear or not useful (click again to undo)">down vote</a>
    
    <a class="star-off" href="#" title="This is a favorite question (click again to undo)">favorite</a>
    <div class="favoritecount"><b></b></div>   

 
</div>

            </td>
            
<td class="postcell">
<div>
    <div class="post-text" itemprop="description">
        <p>In my program, I have three folders listed under src 
directory: files, sound, images. I am not sure why my code did not 
detected.  When I run the program, I got this message: 
"java.io.FileNotFoundException: files\7.txt (The system cannot find the 
path specified)".  I have image attached here.  Please help.</p>

<p>below is my code:</p>

<pre style="" class="lang-java prettyprint prettyprinted"><code><span class="kwd">package</span><span class="pln"> riddle</span><span class="pun">;</span><span class="pln">

</span><span class="kwd">import</span><span class="pln"> java</span><span class="pun">.</span><span class="pln">awt</span><span class="pun">.</span><span class="typ">BorderLayout</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">import</span><span class="pln"> java</span><span class="pun">.</span><span class="pln">awt</span><span class="pun">.</span><span class="typ">Color</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">import</span><span class="pln"> java</span><span class="pun">.</span><span class="pln">awt</span><span class="pun">.</span><span class="typ">Dimension</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">import</span><span class="pln"> java</span><span class="pun">.</span><span class="pln">awt</span><span class="pun">.</span><span class="typ">Font</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">import</span><span class="pln"> java</span><span class="pun">.</span><span class="pln">awt</span><span class="pun">.</span><span class="typ">GridLayout</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">import</span><span class="pln"> java</span><span class="pun">.</span><span class="pln">awt</span><span class="pun">.</span><span class="pln">event</span><span class="pun">.</span><span class="typ">ActionEvent</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">import</span><span class="pln"> java</span><span class="pun">.</span><span class="pln">awt</span><span class="pun">.</span><span class="pln">event</span><span class="pun">.</span><span class="typ">ActionListener</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">import</span><span class="pln"> java</span><span class="pun">.</span><span class="pln">io</span><span class="pun">.</span><span class="typ">BufferedReader</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">import</span><span class="pln"> java</span><span class="pun">.</span><span class="pln">io</span><span class="pun">.</span><span class="typ">File</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">import</span><span class="pln"> java</span><span class="pun">.</span><span class="pln">io</span><span class="pun">.</span><span class="typ">FileNotFoundException</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">import</span><span class="pln"> java</span><span class="pun">.</span><span class="pln">io</span><span class="pun">.</span><span class="typ">FileReader</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">import</span><span class="pln"> java</span><span class="pun">.</span><span class="pln">io</span><span class="pun">.</span><span class="typ">IOException</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">import</span><span class="pln"> java</span><span class="pun">.</span><span class="pln">net</span><span class="pun">.</span><span class="pln">URL</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">import</span><span class="pln"> java</span><span class="pun">.</span><span class="pln">util</span><span class="pun">.</span><span class="typ">Random</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">import</span><span class="pln"> javax</span><span class="pun">.</span><span class="pln">sound</span><span class="pun">.</span><span class="pln">sampled</span><span class="pun">.</span><span class="typ">AudioInputStream</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">import</span><span class="pln"> javax</span><span class="pun">.</span><span class="pln">sound</span><span class="pun">.</span><span class="pln">sampled</span><span class="pun">.</span><span class="typ">AudioSystem</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">import</span><span class="pln"> javax</span><span class="pun">.</span><span class="pln">sound</span><span class="pun">.</span><span class="pln">sampled</span><span class="pun">.</span><span class="typ">Clip</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">import</span><span class="pln"> javax</span><span class="pun">.</span><span class="pln">sound</span><span class="pun">.</span><span class="pln">sampled</span><span class="pun">.</span><span class="typ">LineUnavailableException</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">import</span><span class="pln"> javax</span><span class="pun">.</span><span class="pln">sound</span><span class="pun">.</span><span class="pln">sampled</span><span class="pun">.</span><span class="typ">UnsupportedAudioFileException</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">import</span><span class="pln"> javax</span><span class="pun">.</span><span class="pln">swing</span><span class="pun">.</span><span class="typ">BorderFactory</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">import</span><span class="pln"> javax</span><span class="pun">.</span><span class="pln">swing</span><span class="pun">.</span><span class="typ">ButtonGroup</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">import</span><span class="pln"> javax</span><span class="pun">.</span><span class="pln">swing</span><span class="pun">.</span><span class="typ">ImageIcon</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">import</span><span class="pln"> javax</span><span class="pun">.</span><span class="pln">swing</span><span class="pun">.</span><span class="typ">JButton</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">import</span><span class="pln"> javax</span><span class="pun">.</span><span class="pln">swing</span><span class="pun">.</span><span class="typ">JFrame</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">import</span><span class="pln"> javax</span><span class="pun">.</span><span class="pln">swing</span><span class="pun">.</span><span class="typ">JLabel</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">import</span><span class="pln"> javax</span><span class="pun">.</span><span class="pln">swing</span><span class="pun">.</span><span class="typ">JOptionPane</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">import</span><span class="pln"> javax</span><span class="pun">.</span><span class="pln">swing</span><span class="pun">.</span><span class="typ">JPanel</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">import</span><span class="pln"> javax</span><span class="pun">.</span><span class="pln">swing</span><span class="pun">.</span><span class="typ">JRadioButton</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">import</span><span class="pln"> javax</span><span class="pun">.</span><span class="pln">swing</span><span class="pun">.</span><span class="pln">border</span><span class="pun">.</span><span class="typ">Border</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">import</span><span class="pln"> javax</span><span class="pun">.</span><span class="pln">swing</span><span class="pun">.</span><span class="pln">border</span><span class="pun">.</span><span class="typ">CompoundBorder</span><span class="pun">;</span><span class="pln">

</span><span class="kwd">public</span><span class="pln"> </span><span class="kwd">class</span><span class="pln"> </span><span class="typ">Math_Riddle</span><span class="pln"> </span><span class="kwd">extends</span><span class="pln"> </span><span class="typ">JFrame</span><span class="pln"> </span><span class="kwd">implements</span><span class="pln"> </span><span class="typ">ActionListener</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
</span><span class="com">/**
*
*/</span><span class="pln">
</span><span class="kwd">private</span><span class="pln"> </span><span class="kwd">static</span><span class="pln"> </span><span class="kwd">final</span><span class="pln"> </span><span class="kwd">long</span><span class="pln"> serialVersionUID </span><span class="pun">=</span><span class="pln"> </span><span class="lit">1L</span><span class="pun">;</span><span class="pln">
</span><span class="typ">JLabel</span><span class="pln"> lblQuestion</span><span class="pun">;</span><span class="pln">
</span><span class="typ">JLabel</span><span class="pln"> lblImage</span><span class="pun">;</span><span class="pln">
</span><span class="typ">JButton</span><span class="pln"> bOK</span><span class="pun">;</span><span class="pln">
</span><span class="typ">JButton</span><span class="pln"> bExit</span><span class="pun">;</span><span class="pln">
</span><span class="typ">JPanel</span><span class="pln"> radioPanel</span><span class="pun">;</span><span class="pln">
</span><span class="typ">JPanel</span><span class="pln"> panBottom</span><span class="pun">;</span><span class="pln">
</span><span class="typ">JRadioButton</span><span class="pun">[]</span><span class="pln"> radioButton</span><span class="pun">;</span><span class="pln">
</span><span class="typ">String</span><span class="pln"> </span><span class="pun">[]</span><span class="pln"> store </span><span class="pun">;</span><span class="pln">
</span><span class="typ">ButtonGroup</span><span class="pln"> bg</span><span class="pun">;</span><span class="pln">
</span><span class="typ">JButton</span><span class="pln"> bNext</span><span class="pun">;</span><span class="pln">
</span><span class="typ">JPanel</span><span class="pln"> mainPanel</span><span class="pun">;</span><span class="pln">
</span><span class="typ">JPanel</span><span class="pln"> pRight</span><span class="pun">;</span><span class="pln">
</span><span class="typ">JLabel</span><span class="pln"> lblCorrect</span><span class="pun">;</span><span class="pln">
</span><span class="typ">JLabel</span><span class="pln"> lblWrong</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">int</span><span class="pln"> vCorrect </span><span class="pun">=</span><span class="pln"> </span><span class="lit">0</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">int</span><span class="pln"> vWrong </span><span class="pun">=</span><span class="pln"> </span><span class="lit">0</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">public</span><span class="pln"> </span><span class="typ">Math_Riddle</span><span class="pun">()</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
mainPanel </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">JPanel</span><span class="pun">(</span><span class="kwd">new</span><span class="pln"> </span><span class="typ">BorderLayout</span><span class="pun">());</span><span class="pln">
buildingGUI</span><span class="pun">();</span><span class="pln">
listAllFiles</span><span class="pun">();</span><span class="pln">
innitializeAllComponents</span><span class="pun">();</span><span class="pln">
</span><span class="kwd">int</span><span class="pln"> fileNumber </span><span class="pun">=</span><span class="pln"> generateRandomNumber</span><span class="pun">();</span><span class="pln">
</span><span class="typ">String</span><span class="pln"> filePath </span><span class="pun">=</span><span class="pln"> </span><span class="str">"files/"</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> fileNumber </span><span class="pun">+</span><span class="pln"> </span><span class="str">".txt"</span><span class="pun">;</span><span class="pln">
</span><span class="typ">String</span><span class="pln"> strQuestion </span><span class="pun">=</span><span class="pln"> readTextFile</span><span class="pun">(</span><span class="pln">filePath</span><span class="pun">);</span><span class="pln">
store </span><span class="pun">=</span><span class="pln"> strQuestion</span><span class="pun">.</span><span class="pln">toString</span><span class="pun">().</span><span class="pln">split</span><span class="pun">(</span><span class="str">"!!!"</span><span class="pun">);</span><span class="pln">
lblQuestion</span><span class="pun">.</span><span class="pln">setText</span><span class="pun">(</span><span class="str">"&lt;html&gt;"</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> store</span><span class="pun">[</span><span class="lit">0</span><span class="pun">]</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="str">"&lt;/html&gt;"</span><span class="pun">);</span><span class="pln">
</span><span class="com">//I need to get the image and display at the center according</span><span class="pln">
</span><span class="com">//to the fileNumber;</span><span class="pln">
getTheImageAndDisplay</span><span class="pun">(</span><span class="pln">fileNumber</span><span class="pun">);</span><span class="pln">
assignRandomNumberToRadioButton</span><span class="pun">(</span><span class="pln">store</span><span class="pun">[</span><span class="lit">1</span><span class="pun">]);</span><span class="pln">
mainPanel</span><span class="pun">.</span><span class="pln">add</span><span class="pun">(</span><span class="pln">lblQuestion</span><span class="pun">,</span><span class="pln"> </span><span class="typ">BorderLayout</span><span class="pun">.</span><span class="pln">NORTH</span><span class="pun">);</span><span class="pln">
mainPanel</span><span class="pun">.</span><span class="pln">add</span><span class="pun">(</span><span class="pln">radioPanel</span><span class="pun">,</span><span class="pln"> </span><span class="typ">BorderLayout</span><span class="pun">.</span><span class="pln">WEST</span><span class="pun">);</span><span class="pln">
mainPanel</span><span class="pun">.</span><span class="pln">add</span><span class="pun">(</span><span class="pln">panBottom</span><span class="pun">,</span><span class="pln"> </span><span class="typ">BorderLayout</span><span class="pun">.</span><span class="pln">SOUTH</span><span class="pun">);</span><span class="pln">
mainPanel</span><span class="pun">.</span><span class="pln">add</span><span class="pun">(</span><span class="pln">lblImage</span><span class="pun">,</span><span class="pln"> </span><span class="typ">BorderLayout</span><span class="pun">.</span><span class="pln">CENTER</span><span class="pun">);</span><span class="pln">
mainPanel</span><span class="pun">.</span><span class="pln">setPreferredSize</span><span class="pun">(</span><span class="kwd">new</span><span class="pln"> </span><span class="typ">Dimension</span><span class="pun">(</span><span class="lit">640</span><span class="pun">,</span><span class="pln"> </span><span class="lit">480</span><span class="pun">));</span><span class="pln">

</span><span class="kwd">this</span><span class="pun">.</span><span class="pln">getContentPane</span><span class="pun">().</span><span class="pln">add</span><span class="pun">(</span><span class="pln">mainPanel</span><span class="pun">);</span><span class="pln">
</span><span class="pun">}</span><span class="pln">

</span><span class="kwd">private</span><span class="pln"> </span><span class="kwd">void</span><span class="pln"> listAllFiles</span><span class="pun">()</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
</span><span class="com">// TODO Auto-generated method stub</span><span class="pln">
</span><span class="typ">File</span><span class="pln"> file </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">File</span><span class="pun">(</span><span class="str">"."</span><span class="pun">);</span><span class="pln">
</span><span class="kwd">for</span><span class="pun">(</span><span class="typ">String</span><span class="pln"> fileNames </span><span class="pun">:</span><span class="pln"> file</span><span class="pun">.</span><span class="pln">list</span><span class="pun">())</span><span class="pln"> </span><span class="typ">System</span><span class="pun">.</span><span class="pln">out</span><span class="pun">.</span><span class="pln">println</span><span class="pun">(</span><span class="pln">fileNames</span><span class="pun">);</span><span class="pln">
</span><span class="pun">}</span><span class="pln">

</span><span class="kwd">private</span><span class="pln"> </span><span class="kwd">void</span><span class="pln"> getTheImageAndDisplay</span><span class="pun">(</span><span class="kwd">int</span><span class="pln"> fileNumber</span><span class="pun">)</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
</span><span class="com">// TODO Auto-generated method stub</span><span class="pln">
</span><span class="typ">String</span><span class="pln"> filePath </span><span class="pun">=</span><span class="pln"> </span><span class="str">"images/"</span><span class="pun">;</span><span class="pln">
lblImage</span><span class="pun">.</span><span class="pln">setIcon</span><span class="pun">(</span><span class="kwd">new</span><span class="pln"> </span><span class="typ">ImageIcon</span><span class="pun">(</span><span class="pln">filePath </span><span class="pun">+</span><span class="pln"> fileNumber </span><span class="pun">+</span><span class="pln"> </span><span class="str">".png"</span><span class="pun">));</span><span class="pln">
</span><span class="pun">}</span><span class="pln">

</span><span class="kwd">private</span><span class="pln"> </span><span class="kwd">void</span><span class="pln"> assignRandomNumberToRadioButton</span><span class="pun">(</span><span class="typ">String</span><span class="pln"> sAnswer</span><span class="pun">)</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
</span><span class="com">// TODO Auto-generated method stub</span><span class="pln">
</span><span class="kwd">int</span><span class="pln"> number  </span><span class="pun">=</span><span class="pln"> </span><span class="typ">Integer</span><span class="pun">.</span><span class="pln">parseInt</span><span class="pun">(</span><span class="pln">sAnswer</span><span class="pun">.</span><span class="pln">toString</span><span class="pun">().</span><span class="pln">trim</span><span class="pun">());</span><span class="pln">
</span><span class="typ">System</span><span class="pun">.</span><span class="pln">out</span><span class="pun">.</span><span class="pln">println</span><span class="pun">(</span><span class="str">"number: "</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> number</span><span class="pun">);</span><span class="pln">
</span><span class="typ">Random</span><span class="pln"> random </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">Random</span><span class="pun">();</span><span class="pln">
</span><span class="kwd">int</span><span class="pln"> rand </span><span class="pun">=</span><span class="pln"> random</span><span class="pun">.</span><span class="pln">nextInt</span><span class="pun">(</span><span class="lit">4</span><span class="pun">);</span><span class="pln"> </span><span class="com">//This is the number of radioButton.</span><span class="pln">
</span><span class="typ">System</span><span class="pun">.</span><span class="pln">out</span><span class="pun">.</span><span class="pln">println</span><span class="pun">(</span><span class="str">"rand is: "</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> rand</span><span class="pun">);</span><span class="pln">
radioButton</span><span class="pun">[</span><span class="pln">rand</span><span class="pun">].</span><span class="pln">setText</span><span class="pun">(</span><span class="pln">sAnswer</span><span class="pun">);</span><span class="pln">

</span><span class="kwd">if</span><span class="pun">(!</span><span class="pln">radioButton</span><span class="pun">[</span><span class="lit">0</span><span class="pun">].</span><span class="pln">getText</span><span class="pun">().</span><span class="pln">equals</span><span class="pun">(</span><span class="str">""</span><span class="pun">))</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
    radioButton</span><span class="pun">[</span><span class="lit">1</span><span class="pun">].</span><span class="pln">setText</span><span class="pun">(</span><span class="str">""</span><span class="pln"> </span><span class="pun">+(</span><span class="pln"> number </span><span class="pun">+</span><span class="pln"> </span><span class="lit">2</span><span class="pun">));</span><span class="pln">
    radioButton</span><span class="pun">[</span><span class="lit">2</span><span class="pun">].</span><span class="pln">setText</span><span class="pun">(</span><span class="str">""</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="pun">(</span><span class="pln">number </span><span class="pun">-</span><span class="pln"> </span><span class="lit">2</span><span class="pun">));</span><span class="pln">
    radioButton</span><span class="pun">[</span><span class="lit">3</span><span class="pun">].</span><span class="pln">setText</span><span class="pun">(</span><span class="str">""</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="pun">(</span><span class="pln">number </span><span class="pun">+</span><span class="pln"> </span><span class="lit">1</span><span class="pun">));</span><span class="pln">
</span><span class="pun">}</span><span class="pln">
</span><span class="kwd">else</span><span class="pln"> </span><span class="kwd">if</span><span class="pun">(!</span><span class="pln">radioButton</span><span class="pun">[</span><span class="lit">1</span><span class="pun">].</span><span class="pln">getText</span><span class="pun">().</span><span class="pln">equals</span><span class="pun">(</span><span class="str">""</span><span class="pun">))</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
    radioButton</span><span class="pun">[</span><span class="lit">0</span><span class="pun">].</span><span class="pln">setText</span><span class="pun">(</span><span class="str">""</span><span class="pln"> </span><span class="pun">+(</span><span class="pln"> number </span><span class="pun">+</span><span class="pln"> </span><span class="lit">2</span><span class="pun">));</span><span class="pln">
    radioButton</span><span class="pun">[</span><span class="lit">2</span><span class="pun">].</span><span class="pln">setText</span><span class="pun">(</span><span class="str">""</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="pun">(</span><span class="pln">number </span><span class="pun">-</span><span class="pln"> </span><span class="lit">2</span><span class="pun">));</span><span class="pln">
    radioButton</span><span class="pun">[</span><span class="lit">3</span><span class="pun">].</span><span class="pln">setText</span><span class="pun">(</span><span class="str">""</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="pun">(</span><span class="pln">number </span><span class="pun">+</span><span class="pln"> </span><span class="lit">1</span><span class="pun">));</span><span class="pln">
</span><span class="pun">}</span><span class="pln">
</span><span class="kwd">else</span><span class="pln"> </span><span class="kwd">if</span><span class="pun">(!</span><span class="pln">radioButton</span><span class="pun">[</span><span class="lit">2</span><span class="pun">].</span><span class="pln">getText</span><span class="pun">().</span><span class="pln">equals</span><span class="pun">(</span><span class="str">""</span><span class="pun">))</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
    radioButton</span><span class="pun">[</span><span class="lit">1</span><span class="pun">].</span><span class="pln">setText</span><span class="pun">(</span><span class="str">""</span><span class="pln"> </span><span class="pun">+(</span><span class="pln"> number </span><span class="pun">+</span><span class="pln"> </span><span class="lit">2</span><span class="pun">));</span><span class="pln">
    radioButton</span><span class="pun">[</span><span class="lit">0</span><span class="pun">].</span><span class="pln">setText</span><span class="pun">(</span><span class="str">""</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="pun">(</span><span class="pln">number </span><span class="pun">-</span><span class="pln"> </span><span class="lit">2</span><span class="pun">));</span><span class="pln">
    radioButton</span><span class="pun">[</span><span class="lit">3</span><span class="pun">].</span><span class="pln">setText</span><span class="pun">(</span><span class="str">""</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="pun">(</span><span class="pln">number </span><span class="pun">+</span><span class="pln"> </span><span class="lit">1</span><span class="pun">));</span><span class="pln">
</span><span class="pun">}</span><span class="pln">
</span><span class="kwd">else</span><span class="pln"> </span><span class="kwd">if</span><span class="pun">(!</span><span class="pln">radioButton</span><span class="pun">[</span><span class="lit">3</span><span class="pun">].</span><span class="pln">getText</span><span class="pun">().</span><span class="pln">equals</span><span class="pun">(</span><span class="str">""</span><span class="pun">))</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
    radioButton</span><span class="pun">[</span><span class="lit">1</span><span class="pun">].</span><span class="pln">setText</span><span class="pun">(</span><span class="str">""</span><span class="pln"> </span><span class="pun">+(</span><span class="pln"> number </span><span class="pun">+</span><span class="pln"> </span><span class="lit">2</span><span class="pun">));</span><span class="pln">
    radioButton</span><span class="pun">[</span><span class="lit">2</span><span class="pun">].</span><span class="pln">setText</span><span class="pun">(</span><span class="str">""</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="pun">(</span><span class="pln">number </span><span class="pun">-</span><span class="pln"> </span><span class="lit">2</span><span class="pun">));</span><span class="pln">
    radioButton</span><span class="pun">[</span><span class="lit">0</span><span class="pun">].</span><span class="pln">setText</span><span class="pun">(</span><span class="str">""</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="pun">(</span><span class="pln">number </span><span class="pun">+</span><span class="pln"> </span><span class="lit">1</span><span class="pun">));</span><span class="pln">
</span><span class="pun">}</span><span class="pln">
</span><span class="pun">}</span><span class="pln">

</span><span class="com">/**
* Construct GUI.
*/</span><span class="pln">
</span><span class="kwd">private</span><span class="pln"> </span><span class="kwd">void</span><span class="pln"> buildingGUI</span><span class="pun">()</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
lblImage </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">JLabel</span><span class="pun">();</span><span class="pln">
bNext </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">JButton</span><span class="pun">(</span><span class="str">"Next"</span><span class="pun">);</span><span class="pln">
lblQuestion </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">JLabel</span><span class="pun">();</span><span class="pln">
bOK </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">JButton</span><span class="pun">(</span><span class="str">"OK"</span><span class="pun">);</span><span class="pln">
bExit </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">JButton</span><span class="pun">(</span><span class="str">"Exit"</span><span class="pun">);</span><span class="pln">
lblQuestion</span><span class="pun">.</span><span class="pln">setFont</span><span class="pun">(</span><span class="kwd">new</span><span class="pln"> </span><span class="typ">Font</span><span class="pun">(</span><span class="str">"Tahoma"</span><span class="pun">,</span><span class="pln"> </span><span class="typ">Font</span><span class="pun">.</span><span class="pln">PLAIN</span><span class="pun">,</span><span class="pln"> </span><span class="lit">12</span><span class="pun">));</span><span class="pln">
radioPanel </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">JPanel</span><span class="pun">();</span><span class="pln">
panBottom </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">JPanel</span><span class="pun">();</span><span class="pln">
panBottom</span><span class="pun">.</span><span class="pln">setLayout</span><span class="pun">(</span><span class="kwd">new</span><span class="pln"> </span><span class="typ">GridLayout</span><span class="pun">(</span><span class="lit">1</span><span class="pun">,</span><span class="pln"> </span><span class="lit">2</span><span class="pun">));</span><span class="pln">
panBottom</span><span class="pun">.</span><span class="pln">add</span><span class="pun">(</span><span class="pln">bOK</span><span class="pun">);</span><span class="pln">
panBottom</span><span class="pun">.</span><span class="pln">add</span><span class="pun">(</span><span class="pln">bExit</span><span class="pun">);</span><span class="pln">
bg </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">ButtonGroup</span><span class="pun">();</span><span class="pln">
radioPanel</span><span class="pun">.</span><span class="pln">setLayout</span><span class="pun">(</span><span class="kwd">new</span><span class="pln"> </span><span class="typ">GridLayout</span><span class="pun">(</span><span class="lit">4</span><span class="pun">,</span><span class="pln"> </span><span class="lit">1</span><span class="pun">));</span><span class="pln">
radioButton </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">JRadioButton</span><span class="pun">[</span><span class="lit">4</span><span class="pun">];</span><span class="pln">
radioButton</span><span class="pun">[</span><span class="lit">0</span><span class="pun">]</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">JRadioButton</span><span class="pun">();</span><span class="pln">
radioButton</span><span class="pun">[</span><span class="lit">1</span><span class="pun">]</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">JRadioButton</span><span class="pun">();</span><span class="pln">
radioButton</span><span class="pun">[</span><span class="lit">2</span><span class="pun">]</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">JRadioButton</span><span class="pun">();</span><span class="pln">
radioButton</span><span class="pun">[</span><span class="lit">3</span><span class="pun">]</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">JRadioButton</span><span class="pun">();</span><span class="pln">
radioPanel</span><span class="pun">.</span><span class="pln">setLayout</span><span class="pun">(</span><span class="kwd">new</span><span class="pln"> </span><span class="typ">GridLayout</span><span class="pun">(</span><span class="lit">10</span><span class="pun">,</span><span class="pln"> </span><span class="lit">1</span><span class="pun">));</span><span class="pln">
radioPanel</span><span class="pun">.</span><span class="pln">add</span><span class="pun">(</span><span class="pln">radioButton</span><span class="pun">[</span><span class="lit">0</span><span class="pun">]);</span><span class="pln">
radioPanel</span><span class="pun">.</span><span class="pln">add</span><span class="pun">(</span><span class="pln">radioButton</span><span class="pun">[</span><span class="lit">1</span><span class="pun">]);</span><span class="pln">
radioPanel</span><span class="pun">.</span><span class="pln">add</span><span class="pun">(</span><span class="pln">radioButton</span><span class="pun">[</span><span class="lit">2</span><span class="pun">]);</span><span class="pln">
radioPanel</span><span class="pun">.</span><span class="pln">add</span><span class="pun">(</span><span class="pln">radioButton</span><span class="pun">[</span><span class="lit">3</span><span class="pun">]);</span><span class="pln">
radioPanel</span><span class="pun">.</span><span class="pln">add</span><span class="pun">(</span><span class="kwd">new</span><span class="pln"> </span><span class="typ">JLabel</span><span class="pun">());</span><span class="pln">
radioPanel</span><span class="pun">.</span><span class="pln">add</span><span class="pun">(</span><span class="kwd">new</span><span class="pln"> </span><span class="typ">JLabel</span><span class="pun">());</span><span class="pln">
radioPanel</span><span class="pun">.</span><span class="pln">add</span><span class="pun">(</span><span class="kwd">new</span><span class="pln"> </span><span class="typ">JLabel</span><span class="pun">());</span><span class="pln">
radioPanel</span><span class="pun">.</span><span class="pln">add</span><span class="pun">(</span><span class="pln">bNext</span><span class="pun">);</span><span class="pln">
radioPanel</span><span class="pun">.</span><span class="pln">add</span><span class="pun">(</span><span class="kwd">new</span><span class="pln"> </span><span class="typ">JLabel</span><span class="pun">());</span><span class="pln">
radioPanel</span><span class="pun">.</span><span class="pln">add</span><span class="pun">(</span><span class="kwd">new</span><span class="pln"> </span><span class="typ">JLabel</span><span class="pun">());</span><span class="pln">
bg</span><span class="pun">.</span><span class="pln">add</span><span class="pun">(</span><span class="pln">radioButton</span><span class="pun">[</span><span class="lit">0</span><span class="pun">]);</span><span class="pln">
bg</span><span class="pun">.</span><span class="pln">add</span><span class="pun">(</span><span class="pln">radioButton</span><span class="pun">[</span><span class="lit">1</span><span class="pun">]);</span><span class="pln">
bg</span><span class="pun">.</span><span class="pln">add</span><span class="pun">(</span><span class="pln">radioButton</span><span class="pun">[</span><span class="lit">2</span><span class="pun">]);</span><span class="pln">
bg</span><span class="pun">.</span><span class="pln">add</span><span class="pun">(</span><span class="pln">radioButton</span><span class="pun">[</span><span class="lit">3</span><span class="pun">]);</span><span class="pln">
pRight </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">JPanel</span><span class="pun">();</span><span class="pln">
pRight</span><span class="pun">.</span><span class="pln">setLayout</span><span class="pun">(</span><span class="kwd">new</span><span class="pln"> </span><span class="typ">GridLayout</span><span class="pun">(</span><span class="lit">5</span><span class="pun">,</span><span class="pln"> </span><span class="lit">2</span><span class="pun">));</span><span class="pln">
lblCorrect </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">JLabel</span><span class="pun">();</span><span class="pln">
pRight</span><span class="pun">.</span><span class="pln">add</span><span class="pun">(</span><span class="pln">lblCorrect</span><span class="pun">);</span><span class="pln">
lblWrong </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">JLabel</span><span class="pun">();</span><span class="pln">
pRight</span><span class="pun">.</span><span class="pln">add</span><span class="pun">(</span><span class="pln">lblWrong</span><span class="pun">);</span><span class="pln">
pRight</span><span class="pun">.</span><span class="pln">add</span><span class="pun">(</span><span class="kwd">new</span><span class="pln"> </span><span class="typ">JLabel</span><span class="pun">(</span><span class="str">"                   "</span><span class="pun">));</span><span class="pln">
pRight</span><span class="pun">.</span><span class="pln">add</span><span class="pun">(</span><span class="kwd">new</span><span class="pln"> </span><span class="typ">JLabel</span><span class="pun">(</span><span class="str">"                   "</span><span class="pun">));</span><span class="pln">
mainPanel</span><span class="pun">.</span><span class="pln">add</span><span class="pun">(</span><span class="pln">pRight</span><span class="pun">,</span><span class="pln"> </span><span class="typ">BorderLayout</span><span class="pun">.</span><span class="pln">EAST</span><span class="pun">);</span><span class="pln">
</span><span class="pun">}</span><span class="pln">

</span><span class="kwd">private</span><span class="pln"> </span><span class="kwd">int</span><span class="pln"> generateRandomNumber</span><span class="pun">()</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
</span><span class="com">// TODO Auto-generated method stub</span><span class="pln">
</span><span class="typ">Random</span><span class="pln"> random </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">Random</span><span class="pun">();</span><span class="pln">
</span><span class="kwd">int</span><span class="pln"> rand </span><span class="pun">=</span><span class="pln"> random</span><span class="pun">.</span><span class="pln">nextInt</span><span class="pun">(</span><span class="lit">20</span><span class="pun">);</span><span class="pln">  </span><span class="com">//This is the number of Files in the system.</span><span class="pln">
</span><span class="kwd">return</span><span class="pln"> rand</span><span class="pun">;</span><span class="pln">
</span><span class="pun">}</span><span class="pln">

</span><span class="kwd">private</span><span class="pln"> </span><span class="kwd">void</span><span class="pln"> innitializeAllComponents</span><span class="pun">()</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
</span><span class="com">// TODO Auto-generated method stub</span><span class="pln">
</span><span class="typ">CompoundBorder</span><span class="pln"> border</span><span class="pun">;</span><span class="pln">
</span><span class="typ">Border</span><span class="pln"> raisedbevel </span><span class="pun">=</span><span class="pln"> </span><span class="typ">BorderFactory</span><span class="pun">.</span><span class="pln">createRaisedBevelBorder</span><span class="pun">();</span><span class="pln">
</span><span class="typ">Border</span><span class="pln"> loweredbevel </span><span class="pun">=</span><span class="pln"> </span><span class="typ">BorderFactory</span><span class="pun">.</span><span class="pln">createLoweredBevelBorder</span><span class="pun">();</span><span class="pln">
border </span><span class="pun">=</span><span class="pln"> </span><span class="typ">BorderFactory</span><span class="pun">.</span><span class="pln">createCompoundBorder</span><span class="pun">(</span><span class="pln"> raisedbevel</span><span class="pun">,</span><span class="pln"> loweredbevel</span><span class="pun">);</span><span class="pln">
lblQuestion</span><span class="pun">.</span><span class="pln">setFont</span><span class="pun">(</span><span class="kwd">new</span><span class="pln"> </span><span class="typ">Font</span><span class="pun">(</span><span class="str">"Tahoma"</span><span class="pun">,</span><span class="pln"> </span><span class="typ">Font</span><span class="pun">.</span><span class="pln">PLAIN</span><span class="pun">,</span><span class="pln"> </span><span class="lit">18</span><span class="pun">));</span><span class="pln">
lblQuestion</span><span class="pun">.</span><span class="pln">setBorder</span><span class="pun">(</span><span class="typ">BorderFactory</span><span class="pun">.</span><span class="pln">createLineBorder</span><span class="pun">(</span><span class="typ">Color</span><span class="pun">.</span><span class="pln">GREEN</span><span class="pun">));</span><span class="pln">
lblQuestion</span><span class="pun">.</span><span class="pln">setBorder</span><span class="pun">(</span><span class="pln">border</span><span class="pun">);</span><span class="pln">
radioPanel</span><span class="pun">.</span><span class="pln">setBorder</span><span class="pun">(</span><span class="pln">border</span><span class="pun">);</span><span class="pln">
pRight</span><span class="pun">.</span><span class="pln">setBorder</span><span class="pun">(</span><span class="pln">border</span><span class="pun">);</span><span class="pln">
panBottom</span><span class="pun">.</span><span class="pln">setBorder</span><span class="pun">(</span><span class="pln">border</span><span class="pun">);</span><span class="pln">
radioButton</span><span class="pun">[</span><span class="lit">0</span><span class="pun">].</span><span class="pln">setFont</span><span class="pun">(</span><span class="kwd">new</span><span class="pln"> </span><span class="typ">Font</span><span class="pun">(</span><span class="str">"Tahoma"</span><span class="pun">,</span><span class="pln"> </span><span class="typ">Font</span><span class="pun">.</span><span class="pln">BOLD</span><span class="pun">,</span><span class="pln"> </span><span class="lit">16</span><span class="pun">));</span><span class="pln">
radioButton</span><span class="pun">[</span><span class="lit">1</span><span class="pun">].</span><span class="pln">setFont</span><span class="pun">(</span><span class="kwd">new</span><span class="pln"> </span><span class="typ">Font</span><span class="pun">(</span><span class="str">"Tahoma"</span><span class="pun">,</span><span class="pln"> </span><span class="typ">Font</span><span class="pun">.</span><span class="pln">BOLD</span><span class="pun">,</span><span class="pln"> </span><span class="lit">16</span><span class="pun">));</span><span class="pln">
radioButton</span><span class="pun">[</span><span class="lit">2</span><span class="pun">].</span><span class="pln">setFont</span><span class="pun">(</span><span class="kwd">new</span><span class="pln"> </span><span class="typ">Font</span><span class="pun">(</span><span class="str">"Tahoma"</span><span class="pun">,</span><span class="pln"> </span><span class="typ">Font</span><span class="pun">.</span><span class="pln">BOLD</span><span class="pun">,</span><span class="pln"> </span><span class="lit">16</span><span class="pun">));</span><span class="pln">
radioButton</span><span class="pun">[</span><span class="lit">3</span><span class="pun">].</span><span class="pln">setFont</span><span class="pun">(</span><span class="kwd">new</span><span class="pln"> </span><span class="typ">Font</span><span class="pun">(</span><span class="str">"Tahoma"</span><span class="pun">,</span><span class="pln"> </span><span class="typ">Font</span><span class="pun">.</span><span class="pln">BOLD</span><span class="pun">,</span><span class="pln"> </span><span class="lit">16</span><span class="pun">));</span><span class="pln">
lblCorrect</span><span class="pun">.</span><span class="pln">setFont</span><span class="pun">(</span><span class="kwd">new</span><span class="pln"> </span><span class="typ">Font</span><span class="pun">(</span><span class="str">"Tahoma"</span><span class="pun">,</span><span class="pln"> </span><span class="typ">Font</span><span class="pun">.</span><span class="pln">BOLD</span><span class="pun">,</span><span class="pln"> </span><span class="lit">14</span><span class="pun">));</span><span class="pln">
lblCorrect</span><span class="pun">.</span><span class="pln">setForeground</span><span class="pun">(</span><span class="typ">Color</span><span class="pun">.</span><span class="pln">BLUE</span><span class="pun">);</span><span class="pln">
lblCorrect</span><span class="pun">.</span><span class="pln">setHorizontalAlignment</span><span class="pun">(</span><span class="typ">JLabel</span><span class="pun">.</span><span class="pln">CENTER</span><span class="pun">);</span><span class="pln">
lblWrong</span><span class="pun">.</span><span class="pln">setFont</span><span class="pun">(</span><span class="kwd">new</span><span class="pln"> </span><span class="typ">Font</span><span class="pun">(</span><span class="str">"Tahoma"</span><span class="pun">,</span><span class="pln"> </span><span class="typ">Font</span><span class="pun">.</span><span class="pln">BOLD</span><span class="pun">,</span><span class="pln"> </span><span class="lit">14</span><span class="pun">));</span><span class="pln">
lblWrong</span><span class="pun">.</span><span class="pln">setForeground</span><span class="pun">(</span><span class="typ">Color</span><span class="pun">.</span><span class="pln">red</span><span class="pun">);</span><span class="pln">
lblWrong</span><span class="pun">.</span><span class="pln">setHorizontalAlignment</span><span class="pun">(</span><span class="typ">JLabel</span><span class="pun">.</span><span class="pln">CENTER</span><span class="pun">);</span><span class="pln">
bNext</span><span class="pun">.</span><span class="pln">addActionListener</span><span class="pun">(</span><span class="kwd">this</span><span class="pun">);</span><span class="pln">
</span><span class="pun">}</span><span class="pln">
</span><span class="lit">@SuppressWarnings</span><span class="pun">(</span><span class="str">"resource"</span><span class="pun">)</span><span class="pln">
</span><span class="kwd">private</span><span class="pln"> </span><span class="kwd">static</span><span class="pln"> </span><span class="typ">String</span><span class="pln"> readTextFile</span><span class="pun">(</span><span class="typ">String</span><span class="pln"> fileName</span><span class="pun">)</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
</span><span class="com">// TODO Auto-generated method stub</span><span class="pln">
</span><span class="typ">BufferedReader</span><span class="pln"> reader</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">try</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
    reader </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">BufferedReader</span><span class="pun">(</span><span class="kwd">new</span><span class="pln"> </span><span class="typ">FileReader</span><span class="pun">(</span><span class="pln">fileName</span><span class="pun">));</span><span class="pln">
    </span><span class="typ">String</span><span class="pln"> line </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">null</span><span class="pun">;</span><span class="pln">
    </span><span class="typ">StringBuilder</span><span class="pln">  stringBuilder </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">StringBuilder</span><span class="pun">();</span><span class="pln">
    </span><span class="typ">String</span><span class="pln"> ls </span><span class="pun">=</span><span class="pln"> </span><span class="typ">System</span><span class="pun">.</span><span class="pln">getProperty</span><span class="pun">(</span><span class="str">"line.separator"</span><span class="pun">);</span><span class="pln">
    </span><span class="kwd">try</span><span class="pln">
    </span><span class="pun">{</span><span class="pln">
        </span><span class="kwd">while</span><span class="pun">((</span><span class="pln"> line </span><span class="pun">=</span><span class="pln"> reader</span><span class="pun">.</span><span class="pln">readLine</span><span class="pun">())</span><span class="pln"> </span><span class="pun">!=</span><span class="pln"> </span><span class="kwd">null</span><span class="pln"> </span><span class="pun">)</span><span class="pln">
        </span><span class="pun">{</span><span class="pln">
            stringBuilder</span><span class="pun">.</span><span class="pln">append</span><span class="pun">(</span><span class="pln">line</span><span class="pun">);</span><span class="pln">
            stringBuilder</span><span class="pun">.</span><span class="pln">append</span><span class="pun">(</span><span class="pln">ls</span><span class="pun">);</span><span class="pln">
        </span><span class="pun">}</span><span class="pln">
    </span><span class="pun">}</span><span class="pln">
    </span><span class="kwd">catch</span><span class="pln"> </span><span class="pun">(</span><span class="typ">IOException</span><span class="pln"> e</span><span class="pun">)</span><span class="pln">
    </span><span class="pun">{</span><span class="pln">
        </span><span class="com">// TODO Auto-generated catch block</span><span class="pln">
        e</span><span class="pun">.</span><span class="pln">printStackTrace</span><span class="pun">();</span><span class="pln">
        </span><span class="kwd">return</span><span class="pln"> </span><span class="kwd">null</span><span class="pun">;</span><span class="pln">
    </span><span class="pun">}</span><span class="pln">
    </span><span class="kwd">return</span><span class="pln"> stringBuilder</span><span class="pun">.</span><span class="pln">toString</span><span class="pun">();</span><span class="pln">
</span><span class="pun">}</span><span class="pln">
</span><span class="kwd">catch</span><span class="pln"> </span><span class="pun">(</span><span class="typ">FileNotFoundException</span><span class="pln"> e</span><span class="pun">)</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
    </span><span class="com">// TODO Auto-generated catch block</span><span class="pln">
    e</span><span class="pun">.</span><span class="pln">printStackTrace</span><span class="pun">();</span><span class="pln">
    </span><span class="kwd">return</span><span class="pln"> </span><span class="kwd">null</span><span class="pun">;</span><span class="pln">
</span><span class="pun">}</span><span class="pln">
</span><span class="pun">}</span><span class="pln">

</span><span class="lit">@Override</span><span class="pln">
</span><span class="kwd">public</span><span class="pln"> </span><span class="kwd">void</span><span class="pln"> actionPerformed</span><span class="pun">(</span><span class="typ">ActionEvent</span><span class="pln"> ae</span><span class="pun">)</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
</span><span class="com">// TODO Auto-generated method stub</span><span class="pln">
</span><span class="kwd">if</span><span class="pun">(</span><span class="pln">ae</span><span class="pun">.</span><span class="pln">getSource</span><span class="pun">().</span><span class="pln">equals</span><span class="pun">(</span><span class="pln">bNext</span><span class="pun">))</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
    </span><span class="com">//if nothing selected, display a message,</span><span class="pln">
    </span><span class="com">//else: get the answer and display.</span><span class="pln">
    </span><span class="kwd">if</span><span class="pun">(!</span><span class="pln">radioButton</span><span class="pun">[</span><span class="lit">0</span><span class="pun">].</span><span class="pln">isSelected</span><span class="pun">()</span><span class="pln"> </span><span class="pun">&amp;&amp;</span><span class="pln"> </span><span class="pun">!</span><span class="pln">radioButton</span><span class="pun">[</span><span class="lit">1</span><span class="pun">].</span><span class="pln">isSelected</span><span class="pun">()</span><span class="pln"> </span><span class="pun">&amp;&amp;</span><span class="pln">
            </span><span class="pun">!</span><span class="pln">radioButton</span><span class="pun">[</span><span class="lit">2</span><span class="pun">].</span><span class="pln">isSelected</span><span class="pun">()</span><span class="pln"> </span><span class="pun">&amp;&amp;</span><span class="pln"> </span><span class="pun">!</span><span class="pln">radioButton</span><span class="pun">[</span><span class="lit">3</span><span class="pun">].</span><span class="pln">isSelected</span><span class="pun">())</span><span class="pln">
    </span><span class="pun">{</span><span class="pln">
        </span><span class="typ">JOptionPane</span><span class="pun">.</span><span class="pln">showMessageDialog</span><span class="pun">(</span><span class="kwd">this</span><span class="pun">,</span><span class="str">"Please select an Answer."</span><span class="pun">,</span><span class="pln"> </span><span class="str">"Nothing selected"</span><span class="pun">,</span><span class="pln">
                </span><span class="typ">JOptionPane</span><span class="pun">.</span><span class="pln">OK_OPTION</span><span class="pun">);</span><span class="pln">
        </span><span class="kwd">return</span><span class="pun">;</span><span class="pln">
    </span><span class="pun">}</span><span class="pln">
    </span><span class="kwd">else</span><span class="pln"> </span><span class="com">//when user select an answer.</span><span class="pln">
    </span><span class="pun">{</span><span class="pln">
        </span><span class="typ">String</span><span class="pln"> strAnswer </span><span class="pun">=</span><span class="pln"> </span><span class="str">""</span><span class="pun">;</span><span class="pln">
        </span><span class="kwd">if</span><span class="pun">(</span><span class="pln">radioButton</span><span class="pun">[</span><span class="lit">0</span><span class="pun">].</span><span class="pln">isSelected</span><span class="pun">())</span><span class="pln">
        </span><span class="pun">{</span><span class="pln">
            strAnswer </span><span class="pun">=</span><span class="pln"> radioButton</span><span class="pun">[</span><span class="lit">0</span><span class="pun">].</span><span class="pln">getText</span><span class="pun">().</span><span class="pln">trim</span><span class="pun">();</span><span class="pln">
        </span><span class="pun">}</span><span class="pln">
        </span><span class="kwd">else</span><span class="pln"> </span><span class="kwd">if</span><span class="pun">(</span><span class="pln">radioButton</span><span class="pun">[</span><span class="lit">1</span><span class="pun">].</span><span class="pln">isSelected</span><span class="pun">())</span><span class="pln">
        </span><span class="pun">{</span><span class="pln">
            strAnswer </span><span class="pun">=</span><span class="pln"> radioButton</span><span class="pun">[</span><span class="lit">1</span><span class="pun">].</span><span class="pln">getText</span><span class="pun">().</span><span class="pln">trim</span><span class="pun">();</span><span class="pln">
        </span><span class="pun">}</span><span class="pln">
        </span><span class="kwd">else</span><span class="pln"> </span><span class="kwd">if</span><span class="pun">(</span><span class="pln">radioButton</span><span class="pun">[</span><span class="lit">2</span><span class="pun">].</span><span class="pln">isSelected</span><span class="pun">())</span><span class="pln">
        </span><span class="pun">{</span><span class="pln">
            strAnswer </span><span class="pun">=</span><span class="pln"> radioButton</span><span class="pun">[</span><span class="lit">2</span><span class="pun">].</span><span class="pln">getText</span><span class="pun">().</span><span class="pln">trim</span><span class="pun">();</span><span class="pln">
        </span><span class="pun">}</span><span class="pln">
        </span><span class="kwd">else</span><span class="pln"> </span><span class="kwd">if</span><span class="pun">(</span><span class="pln">radioButton</span><span class="pun">[</span><span class="lit">3</span><span class="pun">].</span><span class="pln">isSelected</span><span class="pun">())</span><span class="pln">
        </span><span class="pun">{</span><span class="pln">
            strAnswer </span><span class="pun">=</span><span class="pln"> radioButton</span><span class="pun">[</span><span class="lit">3</span><span class="pun">].</span><span class="pln">getText</span><span class="pun">().</span><span class="pln">trim</span><span class="pun">();</span><span class="pln">
        </span><span class="pun">}</span><span class="pln">
        </span><span class="kwd">if</span><span class="pun">(</span><span class="pln">strAnswer</span><span class="pun">.</span><span class="pln">equals</span><span class="pun">(</span><span class="pln">store</span><span class="pun">[</span><span class="lit">1</span><span class="pun">].</span><span class="pln">trim</span><span class="pun">()))</span><span class="pln">
        </span><span class="pun">{</span><span class="pln">
            </span><span class="typ">String</span><span class="pln"> strCorrect </span><span class="pun">=</span><span class="pln"> lblCorrect</span><span class="pun">.</span><span class="pln">getText</span><span class="pun">();</span><span class="pln">
            </span><span class="kwd">if</span><span class="pun">(</span><span class="pln">strCorrect</span><span class="pun">.</span><span class="pln">equals</span><span class="pun">(</span><span class="str">""</span><span class="pun">))</span><span class="pln">
            </span><span class="pun">{</span><span class="pln">
                strCorrect </span><span class="pun">=</span><span class="pln"> </span><span class="str">"0"</span><span class="pun">;</span><span class="pln">
            </span><span class="pun">}</span><span class="pln">
            vCorrect </span><span class="pun">=</span><span class="pln"> </span><span class="typ">Integer</span><span class="pun">.</span><span class="pln">parseInt</span><span class="pun">(</span><span class="pln">strCorrect</span><span class="pun">);</span><span class="pln">
            vCorrect </span><span class="pun">=</span><span class="pln"> vCorrect </span><span class="pun">+</span><span class="pln"> </span><span class="lit">1</span><span class="pun">;</span><span class="pln">
            lblCorrect</span><span class="pun">.</span><span class="pln">setText</span><span class="pun">(</span><span class="str">""</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> vCorrect</span><span class="pun">);</span><span class="pln">
            playSound</span><span class="pun">(</span><span class="str">"correct"</span><span class="pun">);</span><span class="pln">
        </span><span class="pun">}</span><span class="pln">
        </span><span class="kwd">else</span><span class="pln">
        </span><span class="pun">{</span><span class="pln">
            </span><span class="typ">String</span><span class="pln"> strWrong </span><span class="pun">=</span><span class="pln"> lblWrong</span><span class="pun">.</span><span class="pln">getText</span><span class="pun">();</span><span class="pln">
            </span><span class="kwd">if</span><span class="pun">(</span><span class="pln">strWrong</span><span class="pun">.</span><span class="pln">equals</span><span class="pun">(</span><span class="str">""</span><span class="pun">))</span><span class="pln">
            </span><span class="pun">{</span><span class="pln">
                strWrong </span><span class="pun">=</span><span class="pln"> </span><span class="str">"0"</span><span class="pun">;</span><span class="pln">
            </span><span class="pun">}</span><span class="pln">
            vWrong </span><span class="pun">=</span><span class="pln"> </span><span class="typ">Integer</span><span class="pun">.</span><span class="pln">parseInt</span><span class="pun">(</span><span class="pln">strWrong</span><span class="pun">);</span><span class="pln">
            vWrong </span><span class="pun">=</span><span class="pln"> vWrong </span><span class="pun">+</span><span class="pln"> </span><span class="lit">1</span><span class="pun">;</span><span class="pln">
            lblWrong</span><span class="pun">.</span><span class="pln">setText</span><span class="pun">(</span><span class="str">""</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> vWrong</span><span class="pun">);</span><span class="pln">
            playSound</span><span class="pun">(</span><span class="str">"wrong"</span><span class="pun">);</span><span class="pln">
        </span><span class="pun">}</span><span class="pln">
        </span><span class="kwd">int</span><span class="pln"> fileNumber </span><span class="pun">=</span><span class="pln"> generateRandomNumber</span><span class="pun">();</span><span class="pln">
        </span><span class="typ">String</span><span class="pln"> filePath </span><span class="pun">=</span><span class="pln"> </span><span class="str">"files\\"</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> fileNumber </span><span class="pun">+</span><span class="pln"> </span><span class="str">".txt"</span><span class="pun">;</span><span class="pln">
        </span><span class="typ">System</span><span class="pun">.</span><span class="pln">out</span><span class="pun">.</span><span class="pln">println</span><span class="pun">(</span><span class="str">"filePath: "</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> filePath</span><span class="pun">);</span><span class="pln">
        </span><span class="typ">String</span><span class="pln"> strQuestion </span><span class="pun">=</span><span class="pln"> readTextFile</span><span class="pun">(</span><span class="pln">filePath</span><span class="pun">);</span><span class="pln">
        store </span><span class="pun">=</span><span class="pln"> strQuestion</span><span class="pun">.</span><span class="pln">toString</span><span class="pun">().</span><span class="pln">split</span><span class="pun">(</span><span class="str">"!!!"</span><span class="pun">);</span><span class="pln">
        lblQuestion</span><span class="pun">.</span><span class="pln">setText</span><span class="pun">(</span><span class="str">"&lt;html&gt;"</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> store</span><span class="pun">[</span><span class="lit">0</span><span class="pun">]</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> </span><span class="str">"&lt;/html&gt;"</span><span class="pun">);</span><span class="pln">
        </span><span class="typ">System</span><span class="pun">.</span><span class="pln">out</span><span class="pun">.</span><span class="pln">println</span><span class="pun">(</span><span class="str">"store[0] is: "</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> store</span><span class="pun">[</span><span class="lit">0</span><span class="pun">]);</span><span class="pln">
        </span><span class="typ">System</span><span class="pun">.</span><span class="pln">out</span><span class="pun">.</span><span class="pln">println</span><span class="pun">(</span><span class="str">"store[1]"</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> store</span><span class="pun">[</span><span class="lit">1</span><span class="pun">]);</span><span class="pln">
        clearTextInAllRadioButtons</span><span class="pun">();</span><span class="pln">
        assignRandomNumberToRadioButton</span><span class="pun">(</span><span class="pln">store</span><span class="pun">[</span><span class="lit">1</span><span class="pun">]);</span><span class="pln">
        getTheImageAndDisplay</span><span class="pun">(</span><span class="pln">fileNumber</span><span class="pun">);</span><span class="pln">
    </span><span class="pun">}</span><span class="pln">
</span><span class="pun">}</span><span class="pln">
</span><span class="pun">}</span><span class="pln">

</span><span class="kwd">private</span><span class="pln"> </span><span class="kwd">void</span><span class="pln"> playSound</span><span class="pun">(</span><span class="typ">String</span><span class="pln"> sound</span><span class="pun">)</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
</span><span class="com">// TODO Auto-generated method stub</span><span class="pln">
</span><span class="kwd">try</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
    URL url </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">null</span><span class="pun">;</span><span class="pln">
    </span><span class="kwd">if</span><span class="pun">(</span><span class="pln">sound</span><span class="pun">.</span><span class="pln">equals</span><span class="pun">(</span><span class="str">"correct"</span><span class="pun">))</span><span class="pln">
    </span><span class="pun">{</span><span class="pln">
        url </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">this</span><span class="pun">.</span><span class="pln">getClass</span><span class="pun">().</span><span class="pln">getClassLoader</span><span class="pun">().</span><span class="pln">getResource</span><span class="pun">(</span><span class="str">"sound/ding.wav"</span><span class="pun">);</span><span class="pln">
    </span><span class="pun">}</span><span class="pln">
    </span><span class="kwd">else</span><span class="pln"> </span><span class="kwd">if</span><span class="pun">(</span><span class="pln">sound</span><span class="pun">.</span><span class="pln">equals</span><span class="pun">(</span><span class="str">"wrong"</span><span class="pun">))</span><span class="pln">
    </span><span class="pun">{</span><span class="pln">
        url </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">this</span><span class="pun">.</span><span class="pln">getClass</span><span class="pun">().</span><span class="pln">getClassLoader</span><span class="pun">().</span><span class="pln">getResource</span><span class="pun">(</span><span class="str">"sound/buzz.wav"</span><span class="pun">);</span><span class="pln">
    </span><span class="pun">}</span><span class="pln">
    </span><span class="typ">AudioInputStream</span><span class="pln"> audioIn </span><span class="pun">=</span><span class="pln"> </span><span class="typ">AudioSystem</span><span class="pun">.</span><span class="pln">getAudioInputStream</span><span class="pun">(</span><span class="pln">url</span><span class="pun">);</span><span class="pln">
    </span><span class="com">// Get a sound clip resource.</span><span class="pln">
    </span><span class="typ">Clip</span><span class="pln"> clip </span><span class="pun">=</span><span class="pln"> </span><span class="typ">AudioSystem</span><span class="pun">.</span><span class="pln">getClip</span><span class="pun">();</span><span class="pln">
    </span><span class="com">// Open audio clip and load samples from the audio input stream.</span><span class="pln">
    clip</span><span class="pun">.</span><span class="pln">open</span><span class="pun">(</span><span class="pln">audioIn</span><span class="pun">);</span><span class="pln">
    clip</span><span class="pun">.</span><span class="pln">start</span><span class="pun">();</span><span class="pln">
</span><span class="pun">}</span><span class="pln">
</span><span class="kwd">catch</span><span class="pln"> </span><span class="pun">(</span><span class="typ">UnsupportedAudioFileException</span><span class="pln"> e</span><span class="pun">)</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
    e</span><span class="pun">.</span><span class="pln">printStackTrace</span><span class="pun">();</span><span class="pln">
</span><span class="pun">}</span><span class="pln">
</span><span class="kwd">catch</span><span class="pln"> </span><span class="pun">(</span><span class="typ">IOException</span><span class="pln"> e</span><span class="pun">)</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
    e</span><span class="pun">.</span><span class="pln">printStackTrace</span><span class="pun">();</span><span class="pln">
</span><span class="pun">}</span><span class="pln">
</span><span class="kwd">catch</span><span class="pln"> </span><span class="pun">(</span><span class="typ">LineUnavailableException</span><span class="pln"> e</span><span class="pun">)</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
    e</span><span class="pun">.</span><span class="pln">printStackTrace</span><span class="pun">();</span><span class="pln">
</span><span class="pun">}</span><span class="pln">
</span><span class="pun">}</span><span class="pln">

</span><span class="kwd">private</span><span class="pln"> </span><span class="kwd">void</span><span class="pln"> clearTextInAllRadioButtons</span><span class="pun">()</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
</span><span class="com">// TODO Auto-generated method stub</span><span class="pln">
radioButton</span><span class="pun">[</span><span class="lit">0</span><span class="pun">].</span><span class="pln">setText</span><span class="pun">(</span><span class="str">""</span><span class="pun">);</span><span class="pln">
radioButton</span><span class="pun">[</span><span class="lit">1</span><span class="pun">].</span><span class="pln">setText</span><span class="pun">(</span><span class="str">""</span><span class="pun">);</span><span class="pln">
radioButton</span><span class="pun">[</span><span class="lit">2</span><span class="pun">].</span><span class="pln">setText</span><span class="pun">(</span><span class="str">""</span><span class="pun">);</span><span class="pln">
radioButton</span><span class="pun">[</span><span class="lit">3</span><span class="pun">].</span><span class="pln">setText</span><span class="pun">(</span><span class="str">""</span><span class="pun">);</span><span class="pln">
bg</span><span class="pun">.</span><span class="pln">clearSelection</span><span class="pun">();</span><span class="pln">
</span><span class="pun">}</span><span class="pln">

</span><span class="com">/**
* @param args
*/</span><span class="pln">
</span><span class="kwd">public</span><span class="pln"> </span><span class="kwd">static</span><span class="pln"> </span><span class="kwd">void</span><span class="pln"> main</span><span class="pun">(</span><span class="typ">String</span><span class="pun">[]</span><span class="pln"> s</span><span class="pun">)</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
</span><span class="typ">Math_Riddle</span><span class="pln"> mr </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">Math_Riddle</span><span class="pun">();</span><span class="pln">
mr</span><span class="pun">.</span><span class="pln">setDefaultCloseOperation</span><span class="pun">(</span><span class="typ">JFrame</span><span class="pun">.</span><span class="pln">EXIT_ON_CLOSE</span><span class="pun">);</span><span class="pln">
mr</span><span class="pun">.</span><span class="pln">pack</span><span class="pun">();</span><span class="pln">
mr</span><span class="pun">.</span><span class="pln">setVisible</span><span class="pun">(</span><span class="kwd">true</span><span class="pun">);</span><span class="pln">
</span><span class="pun">}</span><span class="pln">
</span><span class="pun">}</span></code></pre>

<hr>

<p>About the File file = new File(resource.toURI());
here is what I tried but still did not work:</p>

<pre style="" class="lang-java prettyprint prettyprinted"><code><span class="pln">URL url </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">null</span><span class="pun">;</span><span class="pln">
</span><span class="typ">Random</span><span class="pln"> rand </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">Random</span><span class="pun">();</span><span class="pln">
</span><span class="kwd">int</span><span class="pln"> random </span><span class="pun">=</span><span class="pln"> rand</span><span class="pun">.</span><span class="pln">nextInt</span><span class="pun">(</span><span class="lit">19</span><span class="pun">);</span><span class="pln">
</span><span class="typ">String</span><span class="pln"> filePath </span><span class="pun">=</span><span class="pln"> </span><span class="str">"files/"</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> random </span><span class="pun">+</span><span class="pln"> </span><span class="str">".txt"</span><span class="pun">;</span><span class="pln">
</span><span class="typ">System</span><span class="pun">.</span><span class="pln">out</span><span class="pun">.</span><span class="pln">println</span><span class="pun">(</span><span class="str">"file: "</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> filePath</span><span class="pun">);</span><span class="pln">
url </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">this</span><span class="pun">.</span><span class="pln">getClass</span><span class="pun">().</span><span class="pln">getClassLoader</span><span class="pun">().</span><span class="pln">getResource</span><span class="pun">(</span><span class="pln">filePath</span><span class="pun">);</span><span class="pln">
</span><span class="typ">System</span><span class="pun">.</span><span class="pln">out</span><span class="pun">.</span><span class="pln">println</span><span class="pun">(</span><span class="pln">url</span><span class="pun">.</span><span class="pln">toString</span><span class="pun">().</span><span class="pln">trim</span><span class="pun">());</span><span class="pln">
</span><span class="kwd">try</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
</span><span class="typ">File</span><span class="pln"> file </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">File</span><span class="pun">(</span><span class="pln">url</span><span class="pun">.</span><span class="pln">toURI</span><span class="pun">());</span><span class="pln">
</span><span class="pun">}</span><span class="pln">
</span><span class="kwd">catch</span><span class="pln"> </span><span class="pun">(</span><span class="typ">URISyntaxException</span><span class="pln"> e1</span><span class="pun">)</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
</span><span class="com">// TODO Auto-generated catch block</span><span class="pln">
e1</span><span class="pun">.</span><span class="pln">printStackTrace</span><span class="pun">();</span><span class="pln">
</span><span class="pun">}</span><span class="pln">
</span><span class="typ">File</span><span class="pln"> folder </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">File</span><span class="pun">(</span><span class="str">"."</span><span class="pun">);</span><span class="pln">
</span><span class="kwd">for</span><span class="pun">(</span><span class="typ">String</span><span class="pln"> fileNames </span><span class="pun">:</span><span class="pln"> folder</span><span class="pun">.</span><span class="pln">list</span><span class="pun">())</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
</span><span class="typ">System</span><span class="pun">.</span><span class="pln">out</span><span class="pun">.</span><span class="pln">println</span><span class="pun">(</span><span class="pln">fileNames</span><span class="pun">);</span><span class="pln">
</span><span class="pun">}</span><span class="pln">
</span><span class="typ">BufferedReader</span><span class="pln"> reader</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">try</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
reader </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">BufferedReader</span><span class="pun">(</span><span class="kwd">new</span><span class="pln"> </span><span class="typ">FileReader</span><span class="pun">(</span><span class="pln">filePath</span><span class="pun">));</span><span class="pln">
</span><span class="typ">String</span><span class="pln"> line </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">null</span><span class="pun">;</span><span class="pln">
</span><span class="typ">StringBuilder</span><span class="pln">  stringBuilder </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">StringBuilder</span><span class="pun">();</span><span class="pln">
</span><span class="typ">String</span><span class="pln"> ls </span><span class="pun">=</span><span class="pln"> </span><span class="typ">System</span><span class="pun">.</span><span class="pln">getProperty</span><span class="pun">(</span><span class="str">"line.separator"</span><span class="pun">);</span><span class="pln">
</span><span class="kwd">try</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
</span><span class="kwd">while</span><span class="pun">((</span><span class="pln"> line </span><span class="pun">=</span><span class="pln"> reader</span><span class="pun">.</span><span class="pln">readLine</span><span class="pun">())</span><span class="pln"> </span><span class="pun">!=</span><span class="pln"> </span><span class="kwd">null</span><span class="pln"> </span><span class="pun">)</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
stringBuilder</span><span class="pun">.</span><span class="pln">append</span><span class="pun">(</span><span class="pln">line</span><span class="pun">);</span><span class="pln">
stringBuilder</span><span class="pun">.</span><span class="pln">append</span><span class="pun">(</span><span class="pln">ls</span><span class="pun">);</span><span class="pln">
</span><span class="pun">}</span><span class="pln">
</span><span class="pun">}</span><span class="pln">
</span><span class="kwd">catch</span><span class="pln"> </span><span class="pun">(</span><span class="typ">IOException</span><span class="pln"> e</span><span class="pun">)</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
</span><span class="com">// TODO Auto-generated catch block</span><span class="pln">
e</span><span class="pun">.</span><span class="pln">printStackTrace</span><span class="pun">();</span><span class="pln">
</span><span class="pun">}</span><span class="pln">
</span><span class="pun">}</span><span class="pln">
</span><span class="kwd">catch</span><span class="pln"> </span><span class="pun">(</span><span class="typ">FileNotFoundException</span><span class="pln"> e</span><span class="pun">)</span><span class="pln">
</span><span class="pun">{</span><span class="pln">
</span><span class="com">// TODO Auto-generated catch block</span><span class="pln">
e</span><span class="pun">.</span><span class="pln">printStackTrace</span><span class="pun">();</span><span class="pln">
</span><span class="pun">}</span></code></pre>

<p>Below is the error message in eclipse:</p>

<p>file: files/5.txt
file:/C:/JavaProject/Tesing/bin/files/5.txt
.classpath
.project
.settings
bin
images
src
java.io.FileNotFoundException: files\5.txt (The system cannot find the path specified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.(Unknown Source)
    at java.io.FileInputStream.(Unknown Source)
    at java.io.FileReader.(Unknown Source)
    at Testing.actionPerformed(Testing.java:72)</p>

<p>when I tried to list all the files/folder.  It only listed the folder: bin, images, src....as you see above.
Please help.  Thanks in advance.</p>

    </div>
    <div class="post-taglist">
        <a href="http://stackoverflow.com/questions/tagged/java" class="post-tag" title="show questions tagged 'java'" rel="tag">java</a> 
    </div>
    <table class="fw">
    <tbody><tr>
    <td class="vt">









<div class="post-menu"><a href="http://stackoverflow.com/q/15439429" title="short permalink to this question" class="short-link" id="link-post-15439429">share</a><span class="lsep">|</span><a href="http://stackoverflow.com/posts/15439429/edit" class="suggest-edit-post" title="">improve this question</a></div>            </td>
    <td class="post-signature" align="right">


    <div class="user-info user-hover">
        <div class="user-action-time">
                            edited
                             <a href="http://stackoverflow.com/posts/15439429/revisions" title="show all edits to this post"><span title="2013-03-22 10:28:07Z" class="relativetime">Mar 22 at 10:28</span></a>

        </div>
        <div class="user-gravatar32">
            <a href="http://stackoverflow.com/users/1288/bill-the-lizard"><div class=""><img src="java%20-%20Not%20able%20to%20find%20files%20and%20images%20under%20src%20directory%20-%20Stack%20Overflow_files/fc763c6ff6c160ddad05741e87e517b6.png" alt="" height="32" width="32"></div></a>
        </div>
        <div class="user-details">
            <a href="http://stackoverflow.com/users/1288/bill-the-lizard">Bill the Lizard</a><span class="mod-flair" title="moderator">♦</span><br>
            <span class="reputation-score" title="reputation score 110266" dir="ltr">110k</span><span title="83 gold badges"><span class="badge1"></span><span class="badgecount">83</span></span><span title="298 silver badges"><span class="badge2"></span><span class="badgecount">298</span></span><span title="562 bronze badges"><span class="badge3"></span><span class="badgecount">562</span></span>
        </div>
    </div>
    </td>
    <td class="post-signature owner">
        

    <div class="user-info ">
        <div class="user-action-time">
                                    asked
 <span title="2013-03-15 18:14:25Z" class="relativetime">Mar 15 at 18:14</span>
        </div>
        <div class="user-gravatar32">
            <a href="http://stackoverflow.com/users/2155508/danny-phung"><div class=""><img src="java%20-%20Not%20able%20to%20find%20files%20and%20images%20under%20src%20directory%20-%20Stack%20Overflow_files/1253e1e81daf60cb691be5ebdea7a03e.png" alt="" height="32" width="32"></div></a>
        </div>
        <div class="user-details">
            <a href="http://stackoverflow.com/users/2155508/danny-phung">Danny Phung</a><br>
            <span class="reputation-score" title="reputation score" dir="ltr">16</span><span title="1 bronze badge"><span class="badge3"></span><span class="badgecount">1</span></span>
        </div>
    </div>

    </td>
    </tr>
    </tbody></table>
</div>
</td>
        </tr>


<tr>
<td class="votecell"></td>
<td>
    <div id="comments-15439429" class="comments">
        <table>
        <tbody>
                    
    <tr id="comment-21840001" class="comment">
        <td></td>
        <td class="comment-text"><div><span class="comment-copy">Could you narrow it down to only the most relevant parts?</span> –&nbsp;<a href="http://stackoverflow.com/users/1079354/makoto" title="10321 reputation" class="comment-user">Makoto</a> <span class="comment-date" dir="ltr"><a class="comment-link" onclick="StackExchange.question.highlightComment(21840001, 0)" href="#comment21840001_15439429"><span title="2013-03-15 18:15:38Z" class="relativetime-clean">Mar 15 at 18:15</span></a></span></div></td>
    </tr>
            
    <tr id="comment-21840003" class="comment">
        <td></td>
        <td class="comment-text"><div><span class="comment-copy">Why are you putting all this UI code for setting fonts and layouts? Do you think that has anything to do with it?</span> –&nbsp;<a href="http://stackoverflow.com/users/438154/sotirios-delimanolis" title="3867 reputation" class="comment-user">Sotirios Delimanolis</a> <span class="comment-date" dir="ltr"><a class="comment-link" onclick="StackExchange.question.highlightComment(21840003, 0)" href="#comment21840003_15439429"><span title="2013-03-15 18:15:41Z" class="relativetime-clean">Mar 15 at 18:15</span></a></span><span class="edited-yes" title="this comment was edited 2 times"></span></div></td>
    </tr>

        </tbody>
    
        </table>
    </div>
    
</td>
</tr>            </tbody></table>    
</div>


<div id="answers">

    <a name="tab-top"></a>
    <div id="answers-header">
        <div class="subheader answers-subheader">
            <h2>
                    1 Answer
            </h2>
            <div id="tabs">
                <a href="http://stackoverflow.com/questions/15439429/not-able-to-find-files-and-images-under-src-directory?answertab=active#tab-top" title="Answers with the latest activity first">active</a>
<a href="http://stackoverflow.com/questions/15439429/not-able-to-find-files-and-images-under-src-directory?answertab=oldest#tab-top" title="Answers in the order they were provided">oldest</a>
<a class="youarehere" href="http://stackoverflow.com/questions/15439429/not-able-to-find-files-and-images-under-src-directory?answertab=votes#tab-top" title="Answers with the highest score first">votes</a>

            </div>
        </div>    
    </div>    




  
<a name="15439775"></a>
<div id="answer-15439775" class="answer" data-answerid="15439775">
    <table>
        <tbody><tr>
            <td class="votecell">
                

<div class="vote">
    <input value="15439775" type="hidden">
    <a class="vote-up-off" title="This answer is useful (click again to undo)">up vote</a>
    <span class="vote-count-post ">1</span>
    <a class="vote-down-off" title="This answer is not useful (click again to undo)">down vote</a>
    

 
</div>

            </td>
            


<td class="answercell">
    <div class="post-text"><p>You are specifying resource files with 
paths. That only works if you actually know the full path or the 
relative path from current directory; e.g. prepended with "src" as 
suggested in another answer.</p>

<p>It is, however,  much better to include resources in your build 
(whether you build through your IDE or an external build system like 
gradle or maven) so that these files are copied into the classpath (it 
may be that you're already doing this). In this case, you can retrieve 
the resources using the Java classloader, like this:</p>

<pre style="" class="lang-java prettyprint prettyprinted"><code><span class="pln">URL resource </span><span class="pun">=</span><span class="pln"> getClass</span><span class="pun">().</span><span class="pln">getResource</span><span class="pun">(</span><span class="str">"/path/to/resource"</span><span class="pun">);</span></code></pre>

<p>A couple of notes here: </p>

<ol>
<li>The leading "/" specifies that the classloader should search from 
the root package. If it is ommitted, it will search relative from the 
package of the class you're in.</li>
<li>You're getting a URL instead of a File. Quite often, it is possible to use these URL's directly, like in the <code>ImageIcon</code>
 contructor that you're using. One additional benefit with this method 
is that it works if your application is packaged in jar file as well, 
since then the URL will point into the correct location in the jar file.
 However, if you <em>know</em> it is a file, <em>and</em> you need the file reference, it can be converted like this: <code>File file = new File(resource.toURI());</code>. </li>
</ol>

<p>EDIT: The following is an example that should work for Danny, based on his "answer" post with an example.</p>

<pre style="" class="lang-java prettyprint prettyprinted"><code><span class="kwd">import</span><span class="pln"> java</span><span class="pun">.</span><span class="pln">io</span><span class="pun">.</span><span class="typ">BufferedReader</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">import</span><span class="pln"> java</span><span class="pun">.</span><span class="pln">io</span><span class="pun">.</span><span class="typ">File</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">import</span><span class="pln"> java</span><span class="pun">.</span><span class="pln">io</span><span class="pun">.</span><span class="typ">FileReader</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">import</span><span class="pln"> java</span><span class="pun">.</span><span class="pln">io</span><span class="pun">.</span><span class="typ">IOException</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">import</span><span class="pln"> java</span><span class="pun">.</span><span class="pln">net</span><span class="pun">.</span><span class="typ">URISyntaxException</span><span class="pun">;</span><span class="pln">
</span><span class="kwd">import</span><span class="pln"> java</span><span class="pun">.</span><span class="pln">net</span><span class="pun">.</span><span class="pln">URL</span><span class="pun">;</span><span class="pln">

</span><span class="kwd">public</span><span class="pln"> </span><span class="kwd">class</span><span class="pln"> </span><span class="typ">ResourceTest</span><span class="pln"> </span><span class="pun">{</span><span class="pln">

    </span><span class="kwd">public</span><span class="pln"> </span><span class="kwd">static</span><span class="pln"> </span><span class="kwd">void</span><span class="pln"> main</span><span class="pun">(</span><span class="typ">String</span><span class="pun">[]</span><span class="pln"> args</span><span class="pun">)</span><span class="pln"> </span><span class="kwd">throws</span><span class="pln"> </span><span class="typ">IOException</span><span class="pun">,</span><span class="pln"> </span><span class="typ">URISyntaxException</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
        </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">ResourceTest</span><span class="pun">().</span><span class="pln">test</span><span class="pun">();</span><span class="pln">
    </span><span class="pun">}</span><span class="pln">

    </span><span class="kwd">public</span><span class="pln"> </span><span class="kwd">void</span><span class="pln"> test</span><span class="pun">()</span><span class="pln"> </span><span class="kwd">throws</span><span class="pln"> </span><span class="typ">URISyntaxException</span><span class="pun">,</span><span class="pln"> </span><span class="typ">IOException</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
        URL url </span><span class="pun">=</span><span class="pln"> getClass</span><span class="pun">().</span><span class="pln">getClassLoader</span><span class="pun">().</span><span class="pln">getResource</span><span class="pun">(</span><span class="str">"files/1.txt"</span><span class="pun">);</span><span class="pln">
        </span><span class="typ">System</span><span class="pun">.</span><span class="pln">out</span><span class="pun">.</span><span class="pln">println</span><span class="pun">(</span><span class="str">"URL: "</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> url</span><span class="pun">);</span><span class="pln">

        </span><span class="typ">File</span><span class="pln"> file </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">File</span><span class="pun">(</span><span class="pln">url</span><span class="pun">.</span><span class="pln">toURI</span><span class="pun">());</span><span class="pln">
        </span><span class="typ">System</span><span class="pun">.</span><span class="pln">out</span><span class="pun">.</span><span class="pln">println</span><span class="pun">(</span><span class="str">"FILE: "</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> file</span><span class="pun">);</span><span class="pln">

        </span><span class="typ">File</span><span class="pln"> folder </span><span class="pun">=</span><span class="pln"> file</span><span class="pun">.</span><span class="pln">getParentFile</span><span class="pun">();</span><span class="pln">
        </span><span class="typ">System</span><span class="pun">.</span><span class="pln">out</span><span class="pun">.</span><span class="pln">println</span><span class="pun">(</span><span class="str">"FOLDER: "</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> folder</span><span class="pun">);</span><span class="pln">
        </span><span class="typ">System</span><span class="pun">.</span><span class="pln">out</span><span class="pun">.</span><span class="pln">println</span><span class="pun">(</span><span class="str">"FOLDER LIST: "</span><span class="pun">);</span><span class="pln">
        </span><span class="kwd">for</span><span class="pln"> </span><span class="pun">(</span><span class="typ">String</span><span class="pln"> fileName </span><span class="pun">:</span><span class="pln"> folder</span><span class="pun">.</span><span class="pln">list</span><span class="pun">())</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
            </span><span class="typ">System</span><span class="pun">.</span><span class="pln">out</span><span class="pun">.</span><span class="pln">println</span><span class="pun">(</span><span class="str">"  "</span><span class="pln"> </span><span class="pun">+</span><span class="pln"> fileName</span><span class="pun">);</span><span class="pln">
        </span><span class="pun">}</span><span class="pln">

        </span><span class="typ">System</span><span class="pun">.</span><span class="pln">out</span><span class="pun">.</span><span class="pln">println</span><span class="pun">(</span><span class="str">"FILE CONTENTS:"</span><span class="pun">);</span><span class="pln">
        </span><span class="typ">BufferedReader</span><span class="pln"> reader </span><span class="pun">=</span><span class="pln"> </span><span class="kwd">new</span><span class="pln"> </span><span class="typ">BufferedReader</span><span class="pun">(</span><span class="kwd">new</span><span class="pln"> </span><span class="typ">FileReader</span><span class="pun">(</span><span class="pln">file</span><span class="pun">));</span><span class="pln">
        </span><span class="typ">String</span><span class="pln"> line </span><span class="pun">=</span><span class="pln"> reader</span><span class="pun">.</span><span class="pln">readLine</span><span class="pun">();</span><span class="pln">
        </span><span class="kwd">while</span><span class="pln"> </span><span class="pun">(</span><span class="pln">line </span><span class="pun">!=</span><span class="pln"> </span><span class="kwd">null</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln">
            </span><span class="typ">System</span><span class="pun">.</span><span class="pln">out</span><span class="pun">.</span><span class="pln">println</span><span class="pun">(</span><span class="pln">line</span><span class="pun">);</span><span class="pln">
            line </span><span class="pun">=</span><span class="pln"> reader</span><span class="pun">.</span><span class="pln">readLine</span><span class="pun">();</span><span class="pln">
        </span><span class="pun">}</span><span class="pln">
    </span><span class="pun">}</span><span class="pln">
</span><span class="pun">}</span></code></pre>

<p>Which for yields the following output:</p>

<pre style="" class="lang-java prettyprint prettyprinted"><code><span class="pln">URL</span><span class="pun">:</span><span class="pln"> file</span><span class="pun">:/</span><span class="pln">home</span><span class="pun">/</span><span class="pln">steinar</span><span class="pun">/</span><span class="typ">Safe</span><span class="pun">/</span><span class="pln">source</span><span class="pun">/</span><span class="kwd">private</span><span class="pun">/</span><span class="pln">out</span><span class="pun">/</span><span class="pln">production</span><span class="pun">/</span><span class="pln">files</span><span class="pun">/</span><span class="lit">1.txt</span><span class="pln">
FILE</span><span class="pun">:</span><span class="pln"> </span><span class="pun">/</span><span class="pln">home</span><span class="pun">/</span><span class="pln">steinar</span><span class="pun">/</span><span class="typ">Safe</span><span class="pun">/</span><span class="pln">source</span><span class="pun">/</span><span class="kwd">private</span><span class="pun">/</span><span class="pln">out</span><span class="pun">/</span><span class="pln">production</span><span class="pun">/</span><span class="pln">files</span><span class="pun">/</span><span class="lit">1.txt</span><span class="pln">
FOLDER</span><span class="pun">:</span><span class="pln"> </span><span class="pun">/</span><span class="pln">home</span><span class="pun">/</span><span class="pln">steinar</span><span class="pun">/</span><span class="typ">Safe</span><span class="pun">/</span><span class="pln">source</span><span class="pun">/</span><span class="kwd">private</span><span class="pun">/</span><span class="pln">out</span><span class="pun">/</span><span class="pln">production</span><span class="pun">/</span><span class="pln">files
FOLDER LIST</span><span class="pun">:</span><span class="pln"> 
  </span><span class="lit">1.txt</span><span class="pln">
FILE CONTENTS</span><span class="pun">:</span><span class="pln">
</span><span class="typ">This</span><span class="pln"> is
my test
text file</span></code></pre>
</div>
    <table class="fw">
    <tbody><tr>
    <td class="vt">









<div class="post-menu"><a href="http://stackoverflow.com/a/15439775" title="short permalink to this answer" class="short-link" id="link-post-15439775">share</a><span class="lsep">|</span><a href="http://stackoverflow.com/posts/15439775/edit" class="suggest-edit-post" title="">improve this answer</a></div>                    </td>
    <td class="post-signature" align="right">


    <div class="user-info ">
        <div class="user-action-time">
                            edited
                             <a href="http://stackoverflow.com/posts/15439775/revisions" title="show all edits to this post"><span title="2013-03-18 09:43:37Z" class="relativetime">Mar 18 at 9:43</span></a>

        </div>
        <div class="user-gravatar32">
            
        </div>
        <div class="user-details">
            <br>
            
        </div>
    </div>
    </td>
            


    <td class="post-signature" align="right">   
       

    

    <div class="user-info ">
        <div class="user-action-time">
                                    answered
 <span title="2013-03-15 18:35:04Z" class="relativetime">Mar 15 at 18:35</span>
        </div>
        <div class="user-gravatar32">
            <a href="http://stackoverflow.com/users/1969893/steinar"><div class=""><img src="java%20-%20Not%20able%20to%20find%20files%20and%20images%20under%20src%20directory%20-%20Stack%20Overflow_files/5cf9520fa14400f6efc4bdf71b96dc83.jpg" alt="" height="32" width="32"></div></a>
        </div>
        <div class="user-details">
            <a href="http://stackoverflow.com/users/1969893/steinar">Steinar</a><br>
            <span class="reputation-score" title="reputation score" dir="ltr">551</span><span title="1 silver badge"><span class="badge2"></span><span class="badgecount">1</span></span><span title="6 bronze badges"><span class="badge3"></span><span class="badgecount">6</span></span>
        </div>
    </div>

    </td>
    </tr>
    </tbody></table>
</td>
        </tr>



<tr>
<td class="votecell"></td>
<td>
    <div id="comments-15439775" class="comments">
        <table>
        <tbody>
                    
    <tr id="comment-21871972" class="comment">
        <td></td>
        <td class="comment-text"><div><span class="comment-copy">here is what I tried but I did not work: URL url = null;
		Random rand = new Random();
		int random = rand.nextInt(19);
		String filePath = "files/" + random + ".txt";
		System.out.println("file: " + filePath);
		url = this.getClass().getClassLoader().getResource(filePath);
		System.out.println(url.toString().trim());
		File file = new File(".");
		for(String fileNames : file.list())
		{
			System.out.println(fileNames);
		} help please</span> –&nbsp;<a href="http://stackoverflow.com/users/2155508/danny-phung" title="16 reputation" class="comment-user owner">Danny Phung</a> <span class="comment-date" dir="ltr"><a class="comment-link" onclick="StackExchange.question.highlightComment(21871972, 15439775)" href="#comment21871972_15439775"><span title="2013-03-17 04:47:31Z" class="relativetime-clean">Mar 17 at 4:47</span></a></span><span class="edited-yes" title="this comment was edited"></span></div></td>
    </tr>
            
    <tr id="comment-21872027" class="comment">
        <td></td>
        <td class="comment-text"><div><span class="comment-copy">sorry 
for the messy format.  I could not press the Enter key to make new line.
  If I press the Enter key, It just automatically save the comment and 
did not make new line.</span> –&nbsp;<a href="http://stackoverflow.com/users/2155508/danny-phung" title="16 reputation" class="comment-user owner">Danny Phung</a> <span class="comment-date" dir="ltr"><a class="comment-link" onclick="StackExchange.question.highlightComment(21872027, 15439775)" href="#comment21872027_15439775"><span title="2013-03-17 04:53:58Z" class="relativetime-clean">Mar 17 at 4:53</span></a></span><span class="edited-yes" title="this comment was edited 2 times"></span></div></td>
    </tr>
            
    <tr id="comment-21878344" class="comment">
        <td></td>
        <td class="comment-text"><div><span class="comment-copy">Well, 
you're saying it didn't work, but you're not saying what happened. Your 
code example contains a mixture of choosing random files, resolving a 
URL and also listing a file path. Can you tell the the output of this: <code>System.out.println(getClass().getClassLoader().getResource("files/1.txt"));</code> If this is <code>null</code>
 then the resource is not copied into the classpath; then you'll need to
 tell me how you are running (command line? in your IDE? which tool / 
commands do you use). I'm assuming here that the file 1.txt exists and 
is in the files folder in your source directory. Is that the case?</span> –&nbsp;<a href="http://stackoverflow.com/users/1969893/steinar" title="551 reputation" class="comment-user">Steinar</a> <span class="comment-date" dir="ltr"><a class="comment-link" onclick="StackExchange.question.highlightComment(21878344, 15439775)" href="#comment21878344_15439775"><span title="2013-03-17 14:15:42Z" class="relativetime-clean">Mar 17 at 14:15</span></a></span></div></td>
    </tr>
            
    <tr id="comment-21879264" class="comment">
        <td></td>
        <td class="comment-text"><div><span class="comment-copy">thanks 
for the reply.  I am desperate to get this to work.  I am 100% sure that
 the "files/1.txt" exit in the directory.  files directory contains: 
"0,txt, 1.txt .... 20.txt".  I am running this from eclipse.  Here is 
the step: right click in the Text Editor area, run as, Java Application.</span> –&nbsp;<a href="http://stackoverflow.com/users/2155508/danny-phung" title="16 reputation" class="comment-user owner">Danny Phung</a> <span class="comment-date" dir="ltr"><a class="comment-link" onclick="StackExchange.question.highlightComment(21879264, 15439775)" href="#comment21879264_15439775"><span title="2013-03-17 15:02:36Z" class="relativetime-clean">Mar 17 at 15:02</span></a></span></div></td>
    </tr>
            
    <tr id="comment-21898855" class="comment">
        <td></td>
        <td class="comment-text"><div><span class="comment-copy">@DannyPhung
 : From the output described in your "answer", it seems that you get a 
valid url, but you don't use this as starting point for retrieving the 
folder. Note that <code>File folder = new File(.)</code> will return the
 folder for the start directory of the application. I'll update my 
answer to include an example that should work for you.</span> –&nbsp;<a href="http://stackoverflow.com/users/1969893/steinar" title="551 reputation" class="comment-user">Steinar</a> <span class="comment-date" dir="ltr"><a class="comment-link" onclick="StackExchange.question.highlightComment(21898855, 15439775)" href="#comment21898855_15439775"><span title="2013-03-18 09:29:49Z" class="relativetime-clean">Mar 18 at 9:29</span></a></span></div></td>
    </tr>

        </tbody>
    
        </table>
    </div>
    
</td>
</tr>
   
    </tbody></table>
</div>
    <a name="new-answer"></a>
    <form id="post-form" action="/questions/15439429/answer/submit" method="post" class="post-form">
        <input id="post-id" value="15439429" type="hidden">
        <h2 class="space">Your Answer</h2>



    
<script type="text/javascript">
    StackExchange.ready(function() {
        initTagRenderer("".split(" "), "".split(" "));
         
        prepareEditor({
            heartbeatType: 'answer',
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
        });
        

    });  
</script>


<div id="post-editor" class="post-editor">

    <div style="position: relative;">     
        <div class="wmd-container">
            <div id="wmd-button-bar" class="wmd-button-bar"><ul id="wmd-button-row" class="wmd-button-row"><li style="left: 0px;" class="wmd-button" id="wmd-bold-button"><span style="background-position: 0px -20px;"></span></li><li style="left: 25px;" class="wmd-button" id="wmd-italic-button"><span style="background-position: -20px -20px;"></span></li><li style="left: 50px;" class="wmd-spacer" id="wmd-spacer1"><span style="background-position: -40px -20px;"></span></li><li style="left: 75px;" class="wmd-button" id="wmd-link-button"><span style="background-position: -40px -20px;"></span></li><li style="left: 100px;" class="wmd-button" id="wmd-quote-button"><span style="background-position: -60px -20px;"></span></li><li style="left: 125px;" class="wmd-button" id="wmd-code-button"><span style="background-position: -80px -20px;"></span></li><li style="left: 150px;" class="wmd-button" id="wmd-image-button"><span style="background-position: -100px -20px;"></span></li><li style="left: 175px;" class="wmd-spacer" id="wmd-spacer2"><span style="background-position: -120px -20px;"></span></li><li style="left: 200px;" class="wmd-button" id="wmd-olist-button"><span style="background-position: -120px -20px;"></span></li><li style="left: 225px;" class="wmd-button" id="wmd-ulist-button"><span style="background-position: -140px -20px;"></span></li><li style="left: 250px;" class="wmd-button" id="wmd-heading-button"><span style="background-position: -160px -20px;"></span></li><li style="left: 275px;" class="wmd-button" id="wmd-hr-button"><span style="background-position: -180px -20px;"></span></li><li style="left: 300px;" class="wmd-spacer" id="wmd-spacer3"><span style="background-position: -200px -20px;"></span></li><li style="left: 325px;" class="wmd-button" id="wmd-undo-button"><span style="background-position: -200px -20px;"></span></li><li style="left: 350px;" class="wmd-button" id="wmd-redo-button"><span style="background-position: -220px -20px;"></span></li></ul></div>
            <textarea id="wmd-input" class="wmd-input" name="post-text" cols="92" rows="15" tabindex="101" data-min-length=""></textarea>
        </div>
    </div>

    <div class="fl" style="margin-top: 8px; height:24px;">&nbsp;</div>
    <div id="draft-saved" class="draft-saved community-option fl" style="margin-top: 8px; height:24px; display:none;">draft saved</div>

    <div id="draft-discarded" class="draft-discarded community-option fl" style="margin-top: 8px; height:24px; display:none;">draft discarded</div>



    <div id="wmd-preview" class="wmd-preview"></div>
    <div></div>
    <div class="edit-block">
        <input id="fkey" name="fkey" value="d3c890adcb315ce0e9c6e42f15b22e68" type="hidden">
        <input id="author" name="author" type="text">
    </div>
</div>
        <div style="position: relative;"> 
            <div class="form-item new-post-login">
        
                <div class="new-login-form">
                    <div class="new-login-left">
                        <h3>Sign up or <a id="login-link" href="http://stackoverflow.com/users/login?returnurl=%2fquestions%2f15439429%2fnot-able-to-find-files-and-images-under-src-directory%23new-answer">log in</a></h3>
                        <script type="text/javascript">
                            StackExchange.ready(function () {
                                StackExchange.helpers.onClickDraftSave('#login-link');
                            });
                        </script>
                        <div class="preferred-login google-login">
                            <p><span class="icon"></span><span>Sign up using Google</span></p>
                        </div>
                        <div class="preferred-login facebook-login">
                            <p><span class="icon"></span><span>Sign up using Facebook</span></p>
                        </div>
                        <div class="preferred-login stackexchange-login">
                            <p><span class="icon"></span><span>Sign up using Stack Exchange</span></p>
                        </div>
                    </div>
                    <input name="manual-openid" class="manual-openid" type="hidden">
                    <input name="use-facebook" class="use-facebook" value="false" type="hidden">
                    <input class="submit-openid" value="Submit" style="display:none" type="button">
                    <div class="new-login-right">
                                <h3>Post as a guest</h3>
    <div class="form-item">
        <table>
        <tbody><tr>
                    <script type="text/javascript">
                StackExchange.ready(function () {
                    StackExchange.helpers.bindHelpOverlayEvents($('.vm input'));
                });
            </script>
            <td class="vm">
                <div>
                    <label for="display-name">Name</label>
                    <input id="display-name" name="display-name" size="30" maxlength="30" tabindex="105" type="text">
                </div>
                <div>
                    <label for="m-address">Email</label>
                    <input id="m-address" name="m-address" size="30" maxlength="100" tabindex="106" type="text">
                    <span class="edit-field-overlay">required, but not shown</span>
                </div>
            </td>
        </tr>
        </tbody></table>
    </div>

                    </div>
                </div>
            </div>
            <script type="text/javascript">
                StackExchange.ready(
                    function () {
                        StackExchange.openid.initPostLogin('.new-post-login', '%2fquestions%2f15439429%2fnot-able-to-find-files-and-images-under-src-directory%23new-answer');
                    }
                );
            </script>
            <noscript>
                        <h3>Post as a guest</h3>
    <div class="form-item">
        <table>
        <tr>
                    <script type="text/javascript">
                StackExchange.ready(function () {
                    StackExchange.helpers.bindHelpOverlayEvents($('.vm input'));
                });
            </script>
            <td class="vm">
                <div>
                    <label for="display-name">Name</label>
                    <input id="display-name" name="display-name" type="text" size="30" maxlength="30" value="" tabindex="105">
                </div>
                <div>
                    <label for="m-address">Email</label>
                    <input id="m-address" name="m-address" type="text" size="30" maxlength="100" value="" tabindex="106">
                    <span class="edit-field-overlay">required, but not shown</span>
                </div>
            </td>
        </tr>
        </table>
    </div>

            </noscript>
        </div>
           
            <div class="form-submit cbt">
            <input id="submit-button" value="Post Your Answer" tabindex="110" type="submit">
            <a href="#" class="discard-answer dno">discard</a>
    <p class="privacy-policy-agreement">
        By posting your answer, you agree to the 
        <a href="http://stackexchange.com/legal/privacy-policy" target="_blank">privacy policy</a> and 
        <a href="http://stackexchange.com/legal/terms-of-service" target="_blank">terms of service</a>.
    </p>
    <input name="legalLinksShown" value="1" type="hidden">
        </div>
    </form>



        <h2 class="bottom-notice">
                Not the answer you're looking for? 
            Browse other questions tagged <a href="http://stackoverflow.com/questions/tagged/java" class="post-tag" title="show questions tagged 'java'" rel="tag">java</a> 
                or <a href="http://stackoverflow.com/questions/ask">ask your own question</a>.
        </h2>
</div>
</div>
<div id="sidebar" class="show-votes">
        <div class="module question-stats">
        <p class="label-key">tagged</p>
        <div class="tagged"><a href="http://stackoverflow.com/questions/tagged/java" class="post-tag" title="" rel="tag">java</a>&nbsp;<span class="item-multiplier"><span class="item-multiplier-x">×</span>&nbsp;<span class="item-multiplier-count">405630</span></span><br>
</div>
        <table id="qinfo">
            <tbody><tr>
                <td><p class="label-key">asked</p></td>
                <td style="padding-left:10px"><p class="label-key" title="2013-03-15 18:14:25Z"><b>1 month ago</b></p></td>
            </tr>
            <tr>
                <td><p class="label-key">viewed</p></td>

                <td style="padding-left:10px">
                    <p class="label-key">
                        <b>59 times</b>
                    </p>
                </td>
            </tr>
            <tr>
                <td><p class="label-key">active</p></td>
                <td style="padding-left:10px"><p class="label-key"><b><a href="http://stackoverflow.com/questions/15439429/not-able-to-find-files-and-images-under-src-directory?lastactivity" class="lastactivity-link" title="2013-03-22 10:28:07Z">1 month ago</a></b></p></td>
            </tr>
        </tbody></table>
    </div>
        
                <script type="text/javascript">
                var scriptSrc = "http://engine.adzerk.net/z/8277/adzerk1_2_4_43,adzerk2_2_17_45?keywords=java";
                if (document.referrer) {
                    if (/\?/.test(scriptSrc))
                        scriptSrc += "&";
                    else
                        scriptSrc += "?";
                    scriptSrc += "xReferrer=" + document.referrer;
                }
                StackExchange.ready(function () {
                    var z = document.createElement("script");
                    z.type = "text/javascript";
                    z.async = "true";
                    z.src = scriptSrc;
                    var s = document.getElementsByTagName("script")[0];
                    s.parentNode.insertBefore(z, s);
                });
            </script>
        <div class="everyonelovesstackoverflow" id="adzerk2">
        </div>
    <div id="hireme">
        <script type="text/javascript">
            window.careers_adurl="http://careers.stackoverflow.com/gethired/js",window.careers_cssurl="//careerscdn.sstatic.net/careers/gethired/sidebar.min.css?v=7ae83073b37e",window.careers_leaderboardcssurl="//careerscdn.sstatic.net/careers/gethired/ninja.min.css?v=78ccbfa5c59f",window.careers_companycssurl="//careerscdn.sstatic.net/careers/gethired/company",window.careers_adselector="div.hireme, div#hireme",StackExchange.ready(function(){$.ajax({url:"//careerscdn.sstatic.net/careers/gethired/loader.min.js?v=607ab2dda910",dataType:"script",cache:!0})})
        </script>
    </div>



    
  
    
    <div class="module sidebar-related">
        <h4 id="h-related">Related</h4>
        <div class="related" data-tracker="rq=1">
            <div class="spacer">
<a href="http://stackoverflow.com/q/5255337?rq=1" title="Vote score (upvotes - downvotes)">
        <div class="answer-votes default">1</div>
</a>
<a href="http://stackoverflow.com/questions/5255337/jradiobutton-will-not-appear-until-mouse-over?rq=1" class="question-hyperlink">JRadioButton Will not appear until Mouse over</a>
</div>
<div class="spacer">
<a href="http://stackoverflow.com/q/5828548?rq=1" title="Vote score (upvotes - downvotes)">
        <div class="answer-votes default">0</div>
</a>
<a href="http://stackoverflow.com/questions/5828548/not-able-to-transfer-image-file?rq=1" class="question-hyperlink">not able to transfer Image file</a>
</div>
<div class="spacer">
<a href="http://stackoverflow.com/q/6376726?rq=1" title="Vote score (upvotes - downvotes)">
        <div class="answer-votes answered-accepted default">0</div>
</a>
<a href="http://stackoverflow.com/questions/6376726/using-multiple-actionlisteners-in-java-swing?rq=1" class="question-hyperlink">Using Multiple ActionListeners in Java Swing</a>
</div>
<div class="spacer">
<a href="http://stackoverflow.com/q/11708776?rq=1" title="Vote score (upvotes - downvotes)">
        <div class="answer-votes default">0</div>
</a>
<a href="http://stackoverflow.com/questions/11708776/insert-multiple-checkboxes-in-database-table-cell?rq=1" class="question-hyperlink">Insert multiple CheckBoxes in database table cell</a>
</div>
<div class="spacer">
<a href="http://stackoverflow.com/q/13241528?rq=1" title="Vote score (upvotes - downvotes)">
        <div class="answer-votes default">-3</div>
</a>
<a href="http://stackoverflow.com/questions/13241528/finding-a-file-path-in-java-gui-using-file?rq=1" class="question-hyperlink">Finding a file path in java gui using File</a>
</div>
<div class="spacer">
<a href="http://stackoverflow.com/q/13366752?rq=1" title="Vote score (upvotes - downvotes)">
        <div class="answer-votes default">0</div>
</a>
<a href="http://stackoverflow.com/questions/13366752/path-to-file-in-src-directory?rq=1" class="question-hyperlink">Path to file in src directory</a>
</div>
<div class="spacer">
<a href="http://stackoverflow.com/q/13557617?rq=1" title="Vote score (upvotes - downvotes)">
        <div class="answer-votes default">0</div>
</a>
<a href="http://stackoverflow.com/questions/13557617/not-able-to-display-the-image-on-listview?rq=1" class="question-hyperlink">Not able to display the image on listview</a>
</div>
<div class="spacer">
<a href="http://stackoverflow.com/q/13713709?rq=1" title="Vote score (upvotes - downvotes)">
        <div class="answer-votes default">2</div>
</a>
<a href="http://stackoverflow.com/questions/13713709/updating-a-jpanel-from-an-array?rq=1" class="question-hyperlink">Updating a JPanel from an array</a>
</div>
<div class="spacer">
<a href="http://stackoverflow.com/q/13757865?rq=1" title="Vote score (upvotes - downvotes)">
        <div class="answer-votes default">0</div>
</a>
<a href="http://stackoverflow.com/questions/13757865/derby-database-adding-information-to-database-within-java-code?rq=1" class="question-hyperlink">Derby database: Adding information to database within Java code</a>
</div>
<div class="spacer">
<a href="http://stackoverflow.com/q/13853009?rq=1" title="Vote score (upvotes - downvotes)">
        <div class="answer-votes answered-accepted default">1</div>
</a>
<a href="http://stackoverflow.com/questions/13853009/update-frame-or-revalidate-repaint-panel?rq=1" class="question-hyperlink">Update frame or revalidate/repaint panel</a>
</div>

        </div>
    </div>
</div>

<div id="feed-link">
    <div id="feed-link-text"><a href="http://stackoverflow.com/feeds/question/15439429" title="feed of this question and its answers"><span class="feed-icon"></span>question feed</a></div>
</div>
<script type="text/javascript">
StackExchange.ready(function(){$.get('/posts/15439429/ivc/f567');});
</script>
<noscript>
    <div><img src="/posts/15439429/ivc/f567" class="dno" alt="" width="0" height="0"></div>
</noscript><div style="display:none" id="prettify-lang">lang-java</div></div>



        </div>
    </div>
    <div id="footer">
        <div class="footerwrap">
            <div id="footer-menu">
                    <a href="http://stackoverflow.com/about">about</a> |
                <a href="http://stackoverflow.com/faq">faq</a> |
                
                <a href="http://blog.stackexchange.com/?blb=1">blog</a> |
                    <a href="http://chat.stackoverflow.com/">chat</a> |
                <a href="http://data.stackexchange.com/">data</a> |
                <a href="http://stackexchange.com/legal">legal</a> |
                <a href="http://stackexchange.com/legal/privacy-policy">privacy policy</a> |
                <a href="http://stackexchange.com/about/hiring">jobs</a> |
                <a href="http://engine.adzerk.net/redirect/0/2776/2751/0/4de3c60f719c4dfcb1a57531c7050090/0">advertising info</a> |

                <a onclick='StackExchange.switchMobile("on", "/questions/15439429/not-able-to-find-files-and-images-under-src-directory")'>mobile</a> |

                <b><a href="http://stackoverflow.com/help">contact us</a></b>
                  | <b><a href="http://meta.stackoverflow.com/">feedback</a></b>
                <div id="footer-sites">
                    <span style="color:#FE7A15;font-size:140%">■</span>&nbsp;<a href="http://stackoverflow.com/">stackoverflow.com</a>&nbsp; 
<span style="color:#FE7A15;font-size:140%">■</span>&nbsp;<a href="http://stackapps.com/">api/apps</a>&nbsp; 
<span style="color:#FE7A15;font-size:140%">■</span>&nbsp;<a href="http://careers.stackoverflow.com/">careers&nbsp;2.0</a>&nbsp; 
<span style="color:#E8272C;font-size:140%">■</span>&nbsp;<a href="http://serverfault.com/">serverfault.com</a>&nbsp; 
<span style="color:#00AFEF;font-size:140%">■</span>&nbsp;<a href="http://superuser.com/">superuser.com</a>&nbsp; 
<span style="color:#969696;font-size:140%">■</span>&nbsp;<a href="http://meta.stackoverflow.com/">meta</a>&nbsp; 
<span style="color:#46937D;font-size:140%">■</span>&nbsp;<a href="http://area51.stackexchange.com/">area&nbsp;51</a>&nbsp; 
<span style="color:#C0D0DC;font-size:140%">■</span>&nbsp;<a href="http://webapps.stackexchange.com/">webapps</a>&nbsp; 
<span style="color:#000000;font-size:140%">■</span>&nbsp;<a href="http://gaming.stackexchange.com/">gaming</a>&nbsp; 
<span style="color:#dd4814;font-size:140%">■</span>&nbsp;<a href="http://askubuntu.com/">ubuntu</a>&nbsp; 
<span style="color:#9ce4fe;font-size:140%">■</span>&nbsp;<a href="http://webmasters.stackexchange.com/">webmasters</a>&nbsp; 
<span style="color:#cf4d3f;font-size:140%">■</span>&nbsp;<a href="http://cooking.stackexchange.com/">cooking</a>&nbsp; 
<span style="color:#f4f28d;font-size:140%">■</span>&nbsp;<a href="http://gamedev.stackexchange.com/">game development</a>&nbsp; 
<span style="color:#0f3559;font-size:140%">■</span>&nbsp;<a href="http://math.stackexchange.com/">math</a>&nbsp; 
<span style="color:#f2f2f2;font-size:140%">■</span>&nbsp;<a href="http://photo.stackexchange.com/">photography</a>&nbsp; 
<span style="color:#037187;font-size:140%">■</span>&nbsp;<a href="http://stats.stackexchange.com/">stats</a>&nbsp; 
<span style="color:#f1e7cc;font-size:140%">■</span>&nbsp;<a href="http://tex.stackexchange.com/">tex</a>&nbsp; 
<span style="color:#e1cdae;font-size:140%">■</span>&nbsp;<a href="http://english.stackexchange.com/">english</a>&nbsp; 
<span style="color:#a2d9f6;font-size:140%">■</span>&nbsp;<a href="http://cstheory.stackexchange.com/">theoretical cs</a>&nbsp; 
<span style="color:#1b3e6c;font-size:140%">■</span>&nbsp;<a href="http://programmers.stackexchange.com/">programmers</a>&nbsp; 
<span style="color:#293a5d;font-size:140%">■</span>&nbsp;<a href="http://unix.stackexchange.com/">unix</a>&nbsp;
<span style="color:#bec0cb;font-size:140%">■</span>&nbsp;<a href="http://apple.stackexchange.com/">apple</a>&nbsp;
<span style="color:#939185;font-size:140%">■</span>&nbsp;<a href="http://wordpress.stackexchange.com/">wordpress</a>&nbsp;
<span style="color:#ebf5f5;font-size:140%">■</span>&nbsp;<a href="http://physics.stackexchange.com/">physics</a>&nbsp;
<span style="color:#4176ab;font-size:140%">■</span>&nbsp;<a href="http://diy.stackexchange.com/">home&nbsp;improvement</a>&nbsp;
<span style="color:#d1d8d7;font-size:140%">■</span>&nbsp;<a href="http://gis.stackexchange.com/">gis</a>&nbsp;
<span style="color:#e5e2d3;font-size:140%">■</span>&nbsp;<a href="http://electronics.stackexchange.com/">electrical&nbsp;engineering</a>&nbsp;
<span style="color:#a4c639;font-size:140%">■</span>&nbsp;<a href="http://android.stackexchange.com/">android</a>&nbsp;
<span style="color:#2e4e60;font-size:140%">■</span>&nbsp;<a href="http://security.stackexchange.com/">security</a>&nbsp;
<span style="color:#45bcb5;font-size:140%">■</span>&nbsp;<a href="http://bicycles.stackexchange.com/">bicycles</a>&nbsp;
<span style="color:#00adee;font-size:140%">■</span>&nbsp;<a href="http://dba.stackexchange.com/">dba</a>&nbsp;
<span style="color:#2edaf0;font-size:140%">■</span>&nbsp;<a href="http://drupal.stackexchange.com/">drupal</a>&nbsp;
<span style="color:#213951;font-size:140%">■</span>&nbsp;<a href="http://sharepoint.stackexchange.com/">sharepoint</a>&nbsp;
<span style="color:#73abb3;font-size:140%">■</span>&nbsp;<a href="http://scifi.stackexchange.com/">scifi&nbsp;&amp;&nbsp;fantasy</a>&nbsp;
<span style="color:#23629F;font-size:140%">■</span>&nbsp;<a href="http://ux.stackexchange.com/">ux</a>&nbsp;
<span style="color:#faff72;font-size:140%">■</span>&nbsp;<a href="http://skeptics.stackexchange.com/">skeptics</a>&nbsp;
<span style="color:#623121;font-size:140%">■</span>&nbsp;<a href="http://rpg.stackexchange.com/">rpg</a>&nbsp;
<span style="color:#e4be88;font-size:140%">■</span>&nbsp;<a href="http://judaism.stackexchange.com/">judaism</a>&nbsp;
<span style="color:#ffecb1;font-size:140%">■</span>&nbsp;<a href="http://mathematica.stackexchange.com/">mathematica</a>&nbsp;
<span style="color:#1b8598;font-size:140%">■</span>&nbsp;<a href="http://travel.stackexchange.com/">travel</a>&nbsp;
                </div>
            </div>
            <div id="footer-flair">
	            <a href="http://creativecommons.org/licenses/by-sa/3.0/" class="cc-wiki-link"></a>
                <div id="svnrev">rev 2013.4.23.661</div>
                        </div>
            <div id="copyright">
                site design / logo © 2013 stack exchange inc; 
                user contributions licensed under <a href="http://creativecommons.org/licenses/by-sa/3.0/" rel="license">cc-wiki</a> with <a href="http://blog.stackoverflow.com/2009/06/attribution-required/" rel="license">attribution required</a>
            </div>
            

        </div>
    </div>
    <noscript>
        <div id="noscript-warning">Stack Overflow works best with JavaScript enabled<img src="http://pixel.quantserve.com/pixel/p-c1rF4kxgLUzNc.gif" alt="" class="dno"></div>
    </noscript>
    <script type="text/javascript">var _gaq=_gaq||[];_gaq.push(['_setAccount','UA-5620270-1']);
        _gaq.push(['_setCustomVar', 1, 'tags', '|java|']); 
_gaq.push(['_trackPageview']);
    var _qevents = _qevents || [];
    (function(){
        var s=document.getElementsByTagName('script')[0];
        var ga=document.createElement('script');
        ga.type='text/javascript';
        ga.async=true;
        ga.src='http://www.google-analytics.com/ga.js';
        s.parentNode.insertBefore(ga,s);
        var sc=document.createElement('script');
        sc.type='text/javascript';
        sc.async=true;
        sc.src='http://edge.quantserve.com/quant.js'; 
        s.parentNode.insertBefore(sc,s);
    })();
    </script>
    <script type="text/javascript">
        _qevents.push({ qacct: "p-c1rF4kxgLUzNc" });
    </script>        
    

</body></html>